Hello there, I think the reason is that your login session is stored in the 
database. The two programs share a set of databases, so the login status is 
synchronized. The corresponding solution, then copy a set of databases, and 
clear the current login session. Hope you can solve your problem. best wishes. 
Tonghua tonghuaroot 邮箱:tonghuar...@gmail.com 签名由 网易邮箱大师 定制 在2018年05月15日 
06:55,pieceofkayk2...@gmail.com 写道: Hey All, So I have a django project in a 
directory for production.  I have the same exact project in a separate 
repository for development.  I literally have copied and pasted my project over 
and the only changes I have made are switching debug from false to true.  So my 
project has the same database, same code, everything.  When I start up my local 
copy and go to login, the login function does not work.  Below is my simple 
login view.  My code returns the print statement 'User is active' when I sign 
in with a user on my project page; however, my user never gets logged in during 
the next step.  Does anyone have any clues as to why this might be?  Thanks for 
your time. views.py def friend_login(request):     if request.method == 'POST': 
        username = request.POST.get('username')         password = 
request.POST.get('password')         user = authenticate(username=username, 
password=password)         if user:             if user.is_active:              
   # the User model is valid and active, so we can log the user in              
   print 'User is active'                 login(request, user)                 
return HttpResponseRedirect(reverse('main:index'))             else:            
     # An inactive account was used - no logging in!                 print 
'User is inactive'                 return render(request, 
'friends/inactive.html', {'user':user})         else:             # Bad login 
credentials             return HttpResponse("Invalid login details supplied.")  
   else:         # Not a POST, so simply display the login form         return 
render(request, 'friends/login.html', {}) -- You received this message because 
you are subscribed to the Google Groups "Django users" group. To unsubscribe 
from this group and stop receiving emails from it, send an email to 
django-users+unsubscr...@googlegroups.com. To post to this group, send email to 
django-users@googlegroups.com. Visit this group at 
https://groups.google.com/group/django-users. To view this discussion on the 
web visit 
https://groups.google.com/d/msgid/django-users/8821e5bc-0a14-47e2-82bd-8b229daaf50d%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1526344729159.ro52uehtmg0nluz0xgt11rdj%40android.mail.163.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to