Open Source Hacker

Pushing the boundaries of free technology

Main menu

Skip to primary content
Skip to secondary content
  • Home
  • Archives
  • Contact
Follow @moo9000

Tag Archives: users

Creating administrator views with Google App Engine

Posted on 2011-02-22 by Mikko Ohtamaa
1

With Google App Engine, you do not need to provide your own registration and authentication mechanism. Google App Engine supports out of the box

  • Google Accounts
  • OpenId

Creating admin only views was dumb easy. For the basic use case, you don’t even need to touch your Python code.

  • All Google App Engine authentication URLs are provided in /_ah URI space
  • Google App Engine maps URLs to Python scripts using app.yaml file
  • In this file you can specify that the URL requires App Engine application administrator login
  • When accessing such an URL App Engine will present the user a login page with auto-redirect to the page the user was going if the login is succesful
  • You can add Google accounts to admins in App Engine control panel
  • On the local development server you are simply presented a dummy login page where you can choose if you are logged out or not
  • To logout, just visit URL http://localhost:8080/_ah/login?action=Logout

Example app.yaml:

application: lol-apua
version: 1
runtime: python
api_version: 1

handlers:

- url: /media
  static_dir: media

- url: /edit-settings
  script: main.py
  login: admin

- url: /.*
  script: main.py

More info

  • app.yaml configuration options
  • Users API for Python

\"\" Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+

Posted in appengine, python | Tagged administration, administrator, app.yaml, authentication, google appengine, handlers, login, logout, permissions, python, users | 1 Reply

Recent Posts

  • The State of Python in Blockchain 2023 report
  • Building cryptocurrency site with Svelte, Python and TimescaleDB
  • Building a cryptocurrency site with Svelte, Python and TimescaleDB
  • Simple loop parallelization in Python
  • Deform 2.0

Tags

android apache buildout cms css css3 debugging django eclipse firefox git github html5 html5 ios iphone irc javascript joomla jquery linux logging mobile mysql nokia osx phonegap php plone Plone (old) python rss series 60 shell ssh symbian ubuntu unix virtualenv webkit windows Wordpress zodb zope zsh
open source hacker: get your dose of Linux, Ubuntu, Python, Javascript, HTML5 and other cool and free technology.
Google+ profile