views:

805

answers:

3

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.

+1  A: 

The gaeutilities library comes with a session management class that works well:

ars
+3  A: 

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/

Lakshman Prasad
App Engine Patch seems like a much better way to start a project than the SDK alone, thanks!
Josh
A: 

Hi,

I am using gaeutilities session now. However, the problem is that these created sessions are accessible only within the server-side codes. When I try to access them in django template tag, I could retrieve them out. Am I missing something?

Example: Client side (Django template tags)

         {% if request.session["email"]%}
            <p><a href="/logout/"id="menu">Logout</a></p>
            <p class="subtext">GoodBye!</p>
        {% else %}
            <p><a href="/login/"id="menu">Login</a></p>
            <p class="subtext">Welcome!</p>
        {% endif %}

Server side is just a simple self.session['email'] and can be access by all server side files.

Any ideas on how to access them on the client side apart from rendering the session value to the page? I need all client side pages to access the session value.

Queryer