python - Google Apps Engine / Django, calling action upon user login? -


i'm new google apps engine (working on existing project else) , seems bit different django far login login handled google, i'm trying make app creates custom cookie user upon logging in can't seem find handler login action... apologize newbie question appreciate if can point me in right direction on how accomplish this. (just calling action upon user's login)

i'm looking @ tutorials, one: http://www.browse-tutorials.net/tutorial/login-register-logout-python-appengine , says generate links since google handles login can't seem figure solution issue this.

thanks

i solved problem using django middleware system , session. think use of session best way guarantee action happens on login (whereas url can reloaded manually).

django sessions not work out of box, implemented own sessions. however, there exists appengine-specific implementation article points out: http://blog.notdot.net/2010/02/webapps-on-app-engine-part-5-sessions

i implemented middleware class this, , added middleware_classes in settings.py:

class loginmanager(object):     def process_view(self, request, view_func, view_args, view_kwargs):         user = users.get_current_user()         if user not none:             marker = session.get(user.user_id())             if marker none:                 login_action()                 session.set(user.user_id(), "true") 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -