If you are using stock User accounts why are you writing a login view? Just use
On Wednesday, March 19, 2014 3:21:09 PM UTC-5, Don Fox wrote:
-- django.contrib.auth.views.login
You can pass it your own template in the url definition
url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login' )
On Wednesday, March 19, 2014 3:21:09 PM UTC-5, Don Fox wrote:
My project has two superusers who have access to the Django Administration and who manually add about 15 Users who should then be able to login and use the site to do data entry.I'm using the standard code in my viewsdef auth_view(request):username = request.POST.get('username',' ')password = request.POST.get('password',' ')user = auth.authenticate(username=username, password=password) if user is not None:auth.login(request, user)return HttpResponseRedirect('/accounts/loggedin') else:return HttpResponseRediredt('/accounts/invalid') This should check against the users listed in the admin page?However ther is no acknowledgement from the loggedin.hml template.Does anything come to mind that I have newgelected to do to get the login to work.
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/959cd1ce-acc2-4f60-ba3b-576c53fa9c6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment