[Python] Configuração do Django-allauth

Discussão em 'Python' iniciado por Stack, Dezembro 8, 2024.

  1. Stack

    Stack Membro Participativo

    Galera, estou tentando implementar o django-allauth em um projeto pessoal porém não estou conseguindo, na versão 0.20.0 é fácil mas queria tentar na mais recente que é a 0.25.2, não me apresenta nenhum erro, porém quando acesso a url http://127.0.0.1:8000/accounts/login/ nada acontece, segue o código:

    INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'plantonista',
    'django.contrib.sites',
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    ]

    TEMPLATES = [
    {
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': ['templates'],
    'APP_DIRS': True,
    'OPTIONS': {
    'context_processors': [
    'django.template.context_processors.debug',
    'django.template.context_processors.request',
    'django.contrib.auth.context_processors.auth',
    'django.contrib.messages.context_processors.messages',
    'django.template.context_processors.request',
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'django.core.context_processors.static',
    'django.core.context_processors.tz',
    'django.contrib.messages.context_processors.messages',
    'django.core.context_processors.request',
    #'allauth.account.context_processors.account',
    #'allauth.socialaccount.context_processors.socialaccount',
    'django.core.context_processors.csrf',
    ],
    },
    },
    ]

    # Django-Allauth
    AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
    'allauth.account.auth_backends.AuthenticationBackend',
    )

    SITE_ID = 1

    LOGIN_URL = '/accounts/login/'
    LOGIN_REDIRECT_URL = '/'

    ACCOUNT_AUTHENTICATION_METHOD = "username_email"
    ACCOUNT_CONFIRM_EMAIL_ON_GET = False
    ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL = LOGIN_URL
    ACCOUNT_EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL = None

    ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 3
    ACCOUNT_EMAIL_REQUIRED = True
    ACCOUNT_EMAIL_VERIFICATION = None
    ACCOUNT_EMAIL_SUBJECT_PREFIX = "My subject: "
    ACCOUNT_DEFAULT_HTTP_PROTOCOL = "http"

    ACCOUNT_LOGOUT_ON_GET = False
    ACCOUNT_LOGOUT_REDIRECT_URL = "/"
    ACCOUNT_SIGNUP_FORM_CLASS = None
    ACCOUNT_SIGNUP_PASSWORD_VERIFICATION = True
    ACCOUNT_UNIQUE_EMAIL = True
    ACCOUNT_USER_MODEL_USERNAME_FIELD = "username"
    ACCOUNT_USER_MODEL_EMAIL_FIELD = "email"

    ACCOUNT_USERNAME_MIN_LENGTH = 5
    ACCOUNT_USERNAME_BLACKLIST = []
    ACCOUNT_USERNAME_REQUIRED = True
    ACCOUNT_PASSWORD_INPUT_RENDER_VALUE = False
    ACCOUNT_PASSWORD_MIN_LENGTH = 6
    ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True

    Continue reading...

Compartilhe esta Página