Use Email to Login With Django Auth

61 views
Skip to first unread message

Ryan Shepard

unread,
Nov 1, 2018, 8:09:13 AM11/1/18
to Django users
How could i go about allowing people to also use their email to sign into Django instead of a username? I have done research my self and tried creating my own backend for it. But it doesn't work.

ansh srivastav

unread,
Nov 1, 2018, 9:05:22 AM11/1/18
to django...@googlegroups.com
Your question is not clear, please be a bit specific.


Mailtrack Sender notified by
Mailtrack 11/01/18, 6:33:43 PM

On Thu, Nov 1, 2018 at 5:38 PM Ryan Shepard <aaronl...@gmail.com> wrote:
How could i go about allowing people to also use their email to sign into Django instead of a username? I have done research my self and tried creating my own backend for it. But it doesn't 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...@googlegroups.com.
To post to this group, send email to django...@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/d6046362-5149-4edf-adc8-273547213748%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mikhailo Keda

unread,
Nov 1, 2018, 9:15:47 AM11/1/18
to Django users
use email as username)
check this code - https://bitbucket.org/voron-raven/chat/src/1073edbed7700a5bea87bf5b9c08297e7db57af6/core/views.py#lines-267:283
and modify POST to set email as username

Andrew Pinkham

unread,
Nov 1, 2018, 1:44:20 PM11/1/18
to django...@googlegroups.com
You may be interested in django-improved-user, as it provides an email-based User model.

https://pypi.org/project/django-improved-user/

Full disclosure: I am one of the original authors. If you have any trouble with the package or documentation, please open an issue!

Andrew
https://jambonsw.com
https://django-unleashed.com

Deb Das

unread,
Nov 1, 2018, 2:42:26 PM11/1/18
to django...@googlegroups.com
You can query for the given email and get the username, then getting the username do normal Django authentication.

On Thu 1 Nov, 2018, 5:39 PM Ryan Shepard <aaronl...@gmail.com wrote:
How could i go about allowing people to also use their email to sign into Django instead of a username? I have done research my self and tried creating my own backend for it. But it doesn't work.

--

maunish dave

unread,
Nov 1, 2018, 2:48:53 PM11/1/18
to django...@googlegroups.com
Do not use django login authentication instead make your own authentication page 

Ryan Shepard

unread,
Nov 1, 2018, 5:07:23 PM11/1/18
to Django users
That helps a bunch, thank you!

Timothy Cook

unread,
Nov 1, 2018, 5:54:56 PM11/1/18
to django...@googlegroups.com

On Thu, Nov 1, 2018 at 9:08 AM Ryan Shepard <aaronl...@gmail.com> wrote:
How could i go about allowing people to also use their email to sign into Django instead of a username? I have done research my self and tried creating my own backend for it. But it doesn't 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...@googlegroups.com.
To post to this group, send email to django...@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/d6046362-5149-4edf-adc8-273547213748%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Timothy W. Cook, CEO
Data Insights, Inc. 

Derek

unread,
Nov 2, 2018, 7:25:59 AM11/2/18
to Django users

Anirudh Jain

unread,
Nov 2, 2018, 7:33:28 AM11/2/18
to django...@googlegroups.com
Use django allauth library. It's great.

On Thu, 1 Nov 2018, 17:39 Ryan Shepard <aaronl...@gmail.com wrote:
How could i go about allowing people to also use their email to sign into Django instead of a username? I have done research my self and tried creating my own backend for it. But it doesn't work.

--

William Vincent

unread,
Nov 2, 2018, 9:38:11 AM11/2/18
to Django users
As others have noted, the short answer is use django-allauth. Here's a basic implementation that might help: https://github.com/wsvincent/djangox.

Anirudh Jain

unread,
Nov 2, 2018, 9:43:23 AM11/2/18
to django...@googlegroups.com
Hey William

Is it you who runs the website wsvincent.com ? Great stuff you have out there. Keep working man !!

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

William Vincent

unread,
Nov 2, 2018, 10:26:20 AM11/2/18
to Django users
Yes that's me. I'm actually procrastinating on my book by writing up an example of login with email right now. Look for it shortly...

Thanks for the kind words.

William Vincent

unread,
Nov 2, 2018, 12:44:06 PM11/2/18
to Django users


On Thursday, November 1, 2018 at 8:09:13 AM UTC-4, Ryan Shepard wrote:
Reply all
Reply to author
Forward
0 new messages