User authentication with webapp2 on Google App Engine

Session using webapp2 in GAE(Google app Engine).

@abahgat's blog

Google App Engine for Python ships with the capability to manage user accounts without the need of any additional library. This functionality is, however, insufficiently documented. This post will be structured as a step-by-step tutorial addressing user registration, login, password reset and a few other details.

The webapp2 framework on Google App Engine for Python 2.7 is definitely a step forward from the original webapp.
Despite the increase in flexibility and functionality, however, there are a few items that are still more laborious than in other frameworks. The most notable aspect is user account management.

Unsurprisingly, since it is meant to run on Google’s App Engine, using Google Accounts with webapp2 takes one line of code. OpenID authentication, while still defined experimental, is almost trivial to implement as well. There are some open source projects like SimpleAuth that attempt to offer a standard and unified API to…

View original post 1,723 more words


Enable jinja2 and i18n translations on Google AppEngine

GAE and Jinja and adding filters and more, this may be useful dude.

Mikhail Shilkov's blog

My initial goal was to make our new application (based on python/AppEngine) translatable. This means the following requirements:

  1. All strings in the application must be translatable
  2. Translations should preferably stored in separate files
  3. It should be easy to use the translations both in .py files and html templates

The solution that I came to after a couple of hours includes the following components: Babel (string file generation), i18n.gettext (getting strings in code) and jinja2 <% trans %> tag (getting strings in templates). The setup of all this is not obvious, so I’ll put the steps in this blog post. Let’s start!

1. Intall Babel:
You need to install it, not just ref from the application, as you’ll need its comman ‘pybabel’ to generate locale-specific files. I use Windows, so I just downloaded the installation package.
Make sure that Python folders are in your PATH variable. I use Python 2.7, so…

View original post 262 more words