# Email as Login name

**URL:** <https://forum.djangoproject.com/t/email-as-login-name/22610>\
**Category:** The Admin\
**Created:** [July 28, 2023, 3:44pm UTC](https://forum.djangoproject.com/t/email-as-login-name/22610 "2023-07-28T15:44:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![perry7t](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/perry7t/32/12386_2.png) [@perry7t](https://forum.djangoproject.com/u/perry7t)\
**Post date:** [July 28, 2023, 3:44pm UTC](https://forum.djangoproject.com/t/email-as-login-name/22610/1 "2023-07-28T15:44:16Z")

</div>

I am working on the final stage of my shifts app. I studied several tutorials on changing Username to email as login name. But they all mention that I should have done this at the start of the development. Is there a way to change this now I have set up quite a few things in my app?

---

<div class="post-metadata">

**Author:** ![cehceh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/cehceh/32/3415_2.png) [@cehceh](https://forum.djangoproject.com/u/cehceh)\
**Post date:** [July 28, 2023, 5:08pm UTC](https://forum.djangoproject.com/t/email-as-login-name/22610/2 "2023-07-28T17:08:25Z")

</div>

If you are using [django-allauth package](https://github.com/pennersr/django-allauth) I think you can by changing (a setting variable of allauth) in settings.py file

```auto

## Next lines allauth package configurations very important
AUTHENTICATION_BACKENDS = [
    #* Needed to login by username in Django admin, regardless of allauth
    # 'django.contrib.auth.backends.ModelBackend',
    #* allauth specific authentication methods, such as login by e-mail
    'allauth.account.auth_backends.AuthenticationBackend',
    
]

```

And other configurations on django-allauth package [documentation](https://django-allauth.readthedocs.io/en/latest/configuration.html)
