diff --git a/src/config/asgi.py b/src/config/asgi.py index cd6907c..8035013 100644 --- a/src/config/asgi.py +++ b/src/config/asgi.py @@ -1,9 +1,6 @@ """ -ASGI config for config project. +ASGI config for pda-next project. -It exposes the ASGI callable as a module-level variable named ``application``. - -For more information on this file, see https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/ """ diff --git a/src/config/settings.py b/src/config/settings.py index 72bb7bd..ecc43ae 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -30,6 +30,16 @@ INSTALLED_APPS = [ "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", + "allauth", + "allauth.account", +] + +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 email + 'allauth.account.auth_backends.AuthenticationBackend', ] MIDDLEWARE = [ @@ -40,6 +50,7 @@ MIDDLEWARE = [ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", + "allauth.account.middleware.AccountMiddleware", ] ROOT_URLCONF = "config.urls" diff --git a/src/config/urls.py b/src/config/urls.py index bdec395..0bedeba 100644 --- a/src/config/urls.py +++ b/src/config/urls.py @@ -1,5 +1,5 @@ """ -URL configuration for config project. +URL configuration for pda-next. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/5.2/topics/http/urls/ @@ -16,8 +16,9 @@ Including another URLconf """ from django.contrib import admin -from django.urls import path +from django.urls import path, include urlpatterns = [ path("admin/", admin.site.urls), + path('accounts/', include('allauth.urls')), ] diff --git a/src/config/wsgi.py b/src/config/wsgi.py index 27c0377..0087372 100644 --- a/src/config/wsgi.py +++ b/src/config/wsgi.py @@ -1,10 +1,7 @@ """ -WSGI config for config project. +WSGI config for pda-new -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/ +See https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/ """ import os diff --git a/requirements.txt b/src/requirements.txt similarity index 61% rename from requirements.txt rename to src/requirements.txt index f93f5b6..5ca0079 100644 --- a/requirements.txt +++ b/src/requirements.txt @@ -1,6 +1,9 @@ asgiref==3.9.1 Django==5.2.5 +django-allauth==65.12.1 +django-environ==0.12.0 dotenv==0.9.9 +environ==1.0 psycopg==3.2.9 python-dotenv==1.1.1 sqlparse==0.5.3