Yeah it works just fine! Thanks again tevans! On Jul 5, 2:42 am, Tom Evans <tevans...@googlemail.com> wrote: > On Tue, Jul 5, 2011 at 2:10 AM, TuckFrance <aidanai...@gmail.com> wrote: > > Having problems with getting login to work even though it's well > > documented. The pages for success, invalid, and no info provided > > aren't getting used at all. Instead, clicking login always redirects > > to /login which is not what I want. Any ideas? > > > URLconf: > > ... > > (r'^accounts/login/$', 'django.contrib.auth.views.login'), > > > View: > > ... > > def login(request): > ^^^^^^^ > > username = request.POST['username'] > > password = request.POST['password'] > > user = authenticate(username=username, password=password) > > if user is not None: > > if user.is_active: > > login(request, user) > > ^^^^^^^^^^^ > > You're calling a function called 'login' from inside a function called > 'login'. It's not going to end well. Either call your login view > function something else, or import django.contrib.auth.login using a > different name (from django.contrib.auth import login as > django_login). > > Cheers > > Tom
-- 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.