Sometimes your need can be solved simply by extending upon the original login page, without rewriting anything. For example, if you would like to take e-mails rather than usernames (or even both), all you will need is a custom template (saying "e-mail" where it currently reads "username") and a custom backend which will try to match user accounts to the provided information.
Example code that will authenticate an user against either e-mails or usernames:
Cheers,
André Terra (airstrike)
On Sat, Apr 2, 2011 at 7:30 PM, Vjacheslav <mvjacheslav@gmail.com> wrote:
I suggest you to use django.contrib.auth app as your starting point:
1. Form:
2. View
http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/views.py#L24
3. Template
http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/templates/admin/login.html#L30
On Apr 1, 11:03 am, Nge Nge <ngenge.mon...@gmail.com> wrote:
> Hi All
>
> I saved the registered user data into my postgresql database.
> Now I have to create login page. I have to check the requested user
> name and password are in my database. If user name and password are in
> my database, redirect to success.html. How should I do? Pls advise
> me.
>
> Thanks
> nge
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment