Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Google App Engine

You're reading from   Mastering Google App Engine Build robust and highly scalable web applications with Google App Engine

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781784396671
Length 368 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

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 config.py, 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__) 
TEMPLATES_DIRECTORY = os.path.join(CURRENT_DIRECTORY, 'templates') 
JINJA_ENV = jinja2.Environment(loader=jinja2.FileSystemLoader(TEMPLATES_DIRECTORY)) 

The next in logical order...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime