Python Application Configuration - Google App Engine - Google Code
Requiring Login or Administrator Status
Any URL handler can have a
login
setting to restrict visitors to only those users who have signed in, or just those users who are administrators for the application. When a URL handler with alogin
setting matches a URL, the handler first checks whether the user has signed in to the application with a Google account. If not, by default, the user is redirected to the Google sign-in page, and is redirected back to the application URL after signing in or creating an account. You can also configure the app to simply reject requests for a handler from users who are not properly authenticated, instead of redirecting the user to the Google Accounts interface.If the setting is
login: required
, once the user has signed in, the handler proceeds normally.If the setting is
login: admin
, once the user has signed in, the handler checks whether the user is an administrator for the application. If not, the user is given an error message. If the user is an administrator, the handler proceeds.If an application needs different behavior, the application can implement the user handling itself. See the Users API for more information.
An example:
handlers: - url: /profile/.* script: user_profile.py login: required - url: /admin/.* script: admin.py login: admin - url: /.* script: welcome.py
and here's now to lock my google app engine app ...