I recently started appengine-boilerplate, a repository of often used boilerplate code for Google’s App Engine, which allows to quickly setup new projects without having to re-invent the most common wheels. All code is released under the BSD license, and It comes with the following goodies:
- html5-boilerplate (incl. jQuery)
- OpenID authentication
- User preferences data model (with gravatar image link)
- Memcache for datastore objects
- Handlers for /, /profile, /login and /logout
- Custom template tags
- Various tools such as
is_testenv(),decode(input)andslugify(title) app.yamlconfiguration for URL’s which can be accessed publicly, only for logged in users, and only for administrators, all setup to work with html5-boilerplate’s directory structure
html5-boilerplate
html5-boilerplate is a great project initiated by Paul Irish, which provides a boilerplate for cross-browser compatible html5 websites, and also includes a nifty build system which minifies, concatenates and optimizes all the resources of the website to increase the website’s performance.
The build-system is fully integrated into appengine-boilerplate, including a helper script called upload_to_appengine.sh. This scripts initiates the build process, changes the /static symlink to the minified verion, uploads the website to appengine, and reverts /static back to the development environment. Implementing this process can drastically improve the website’s performance.
OpenID
appengine-boilerplate uses the same OpenID provider selection as StackOverflow, based on the openid-selector jQuery plugin:
Memcache
App Engine allows you to directly put datastore entities into memcache, which is commonly used to reduce database reads when viewing a website. Using memcache, only the first user will trigger a database read which places the entities into memcache, and all subsequent users can get them from there until the cache is invalidated either by the website or by App Engine itself. Cache lifetime on App Engine seems to be usually just a few hours, but it will provide a noticeable performance improvement for your visitors.
Using appengine-boilerplate you can use the following commands
import mc mc.cache.get_someitems() # will read from db if not in cache
and invalidate the cache with
mc.cache.get_someitems(clear=True)
Feedback & Additions
One particular feature I’d like to implement in the near future is authentication with OAuth (Twitter, Facebook, etc). I’d love to hear your ideas for further additions, and will happily review and accept pull requests. Please leave your feedback in the comments or drop me a line via chris (at) metachris.org.
And if you want to stay updated, you should follow me on twitter.





April 5th, 2011 at 6:22 pm
Nice! I’ll use this in the next project.
April 6th, 2011 at 4:52 am
PHP I assume? Everyone has a stepmotherly treatment towards us java programmers
April 6th, 2011 at 6:44 am
@ganesh your a idiot
April 11th, 2011 at 8:52 pm
@Foo. It is spelled “you’re”. “Your comment adds nothing to the conversation” would be an example of “your”.
May 10th, 2011 at 11:37 am
About oAuth authentication, Tipfy has an extension for oAuth. It might help checking it out: http://www.tipfy.org/wiki/extensions/auth/oauth/
July 20th, 2011 at 12:42 pm
Hi,
I’m trying to understand folders and files, being pretty new to all of this, would someone mind explaining where the models are supposed to placed?
February 1st, 2012 at 10:20 pm
Thanks for some other wonderful article. The place else may anybody get that type of information in such an ideal method of writing? I have a presentation subsequent week, and I’m at the look for such info.