Book Image

Mastering Google App Engine

By : Mohsin Hijazee, Mohsin Shafique
Book Image

Mastering Google App Engine

By: Mohsin Hijazee, Mohsin Shafique

Overview of this book

Table of Contents (18 chapters)
Mastering Google App Engine
About the Author
About the Reviewers

Putting it all together

Now that we had a look at the various services that are available to us on Google App Engine, it is time to put these things together. We are going to develop a very simple application that lets users log in and log out. Once logged in, users can upload pictures with a title and description. The uploaded pictures are listed on the page along with previews. Each user of course has their own collection when they log in and can't see photos from another user. We use users, namespace, Memcache, Blobstore, and the images API to implement this. Let's go through the code file by file.

First, we have, which contains a few definitions:

import os 
import jinja2 
# Used as key to store rendered photo templates in memcache
PHOTOS_CACHE_KEY = 'photos' 
CURRENT_DIRECTORY = os.path.dirname(__file__) 
JINJA_ENV = jinja2.Environment(loader=jinja2.FileSystemLoader(TEMPLATES_DIRECTORY)) 

The next in logical order...