On Tue, 2009-02-03 at 12:17 +0700, Harryanto Ie wrote: > hmm... i have createed the server, and i have 2 client > site. each client has different module to access and there > are separated when login section. > > i'm doing now is : > i.e : > > def login(request) : > login = > User.objects.get(username=request.POST['uname']) > request.session['userlogin'] = login.name
This looks like a very difficult way to handle logging in. The session already contains a reference to the logged-in user's User instance. So why not just use the normal path? When user #2 logs in, they will get a new session, completely independent of user #1. You seem to be writing your own login layer on top of the existing login layer here. > > return > response_to_render('guest.html',{'userlogin':request.session['userlogin']}) > > def moduleA(request) : --> this is module for 1st client > return > response_to_render('module2.html',{'userlogin':request.session['userlogin']}) > > def moduleB(request) : --> this is module for 2nd client > return > response_to_render('module1.html',{'userlogin':request.session['userlogin']}) So what code is responsible for deciding whether moduleA or moduleB is called? Nothing in this code calls either one. Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---