Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get started with Sessions in Google App Engine / Django?

Tags:

I'm new to Python / GAE / Django. I get that with GAE there are no in-memory sessions per se... but I think I want something equivalent. I read that Django sessions can be backed by BigTable or MemCache, but I never got them working. I guess what I'm asking is "Should I..."

  1. Persist with getting Django sessions working?
  2. Look at some other webapp framework for sessions in particular, or the site in general?
  3. Roll my own?

It seems to me that sessions are not supported out-of-the-box and are somehow not first class citizens. What do you do?!

Thanks.

like image 770
Josh Avatar asked Aug 13 '09 13:08

Josh


1 Answers

The reason django sessions are not supported by App engine out of the box is because django uses database table (model) based sessions, and the django ORM is not supported on appengine.

A solution to this is to make django models work out of the box on appengine. And it has been done by patching django code, in the App Engine Patch project.

Using this patch, as django models work, you get to access django admin, django auth along with the latest django release.

You may also find this blog post on deploying a django application on App engine, useful: http://uswaretech.com/blog/2009/04/develop-twitter-api-application-in-django-and-deploy-on-google-app-engine/

like image 108
lprsd Avatar answered Sep 22 '22 18:09

lprsd