Hi,

gaeutilities includes a session middleware

Just add it in your settings.py

For example, for one app I have

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'common.appengine_utilities.django-
middleware.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
)

Note, this only verified with appengine-patch, and not the django0.96
bundled with appengine. Not saying it doesn't work, just saying I've
never tried it.

Also, the middleware takes advantage of the new session cookie writer.
This is a large performance improvement by storing all session data in
cookies for anonymous requests. In order to switch to the datastore
backed solution for your logged in users, you'll need to reset the
session when they log in. The easiest way to do this after you've
authenticated the user, use request.session.save() to convert the
session to the datastore backed solution.

ie:

user = auth.authenticate()
request.session.save()
auth.login(request, user)

On Mar 11, 12:40 pm, Ritesh Nadhani <rite...@gmail.com> wrote:
> Hi
>
> So I was reading the session utility 
> athttp://code.google.com/p/gaeutilities/wiki/Session. I am using Django
> instead of web.py.
>
> The sample shows code:
>
> self.session = Session()
>
> In django, we dont get an object, rather a method is called, how can I
> store the session object similar to self.session.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to