[Python] How to resolve UserWarnings for deprecated USERNAME_REQUIRED and EMAIL_REQUIRED...

Discussão em 'Python' iniciado por Stack, Abril 14, 2025.

  1. Stack

    Stack Membro Participativo

    In a fresh Django project using a fresh venv, I have installed the following dependencies:

    dj-rest-auth==7.0.1
    Django==5.1.7
    django-allauth==65.5.0
    djangorestframework==3.15.2
    djangorestframework_simplejwt==5.5.0
    social-auth-app-django==5.4.3


    and I have added the following settings:

    ACCOUNT_SIGNUP_FIELDS = ["email*", "password1*", "password2*"]
    ACCOUNT_LOGIN_METHODS = {"email"}
    ACCOUNT_EMAIL_VERIFICATION = "mandatory"


    I can confirm I have added no extra allauth settings.

    Migrations have run successfully, but when I run my server I get:

    .venv/lib/python3.10/site-packages/allauth/account/app_settings.py:540: UserWarning: app_settings.USERNAME_REQUIRED is deprecated, use: app_settings.SIGNUP_FIELDS['username']['required']
    return getattr(_app_settings, name)
    .venv/lib/python3.10/site-packages/allauth/account/app_settings.py:540: UserWarning: app_settings.EMAIL_REQUIRED is deprecated, use: app_settings.SIGNUP_FIELDS['email']['required']
    return getattr(_app_settings, name)
    System check identified no issues (0 silenced).

    Continue reading...

Compartilhe esta Página