{"id":2473,"library":"django-allauth","title":"django-allauth","description":"django-allauth is an integrated set of Django applications that provides comprehensive solutions for authentication, registration, account management, and third-party (social) account authentication. It is actively maintained with frequent releases, often aligning with new Django and Python versions. It aims to offer a unified approach to both local and social authentication flows.","status":"active","version":"65.15.1","language":"python","source_language":"en","source_url":"https://codeberg.org/allauth/django-allauth","tags":["django","authentication","social-login","registration","account-management","multi-factor-authentication"],"install":[{"cmd":"pip install django-allauth","lang":"bash","label":"Basic installation (without social accounts or headless API)"},{"cmd":"pip install \"django-allauth[socialaccount]\"","lang":"bash","label":"With social account providers (most common)"},{"cmd":"pip install \"django-allauth[headless]\"","lang":"bash","label":"With headless API support (e.g., for JWT)"}],"dependencies":[{"reason":"Core framework dependency; django-allauth versions are tied to Django versions.","package":"Django","optional":false}],"imports":[{"wrong":"INSTALLED_APPS = ['allauth', ...]","symbol":"allauth","correct":"import allauth"}],"quickstart":{"code":"import os\n\n# settings.py\n# Add to INSTALLED_APPS (order matters, 'django.contrib.sites' and 'allauth' apps come after Django's built-in apps)\nINSTALLED_APPS = [\n    # ... django defaults\n    'django.contrib.sites',\n    'allauth',\n    'allauth.account',\n    'allauth.socialaccount', # Optional: if using social logins\n    # ... add specific social providers here, e.g., 'allauth.socialaccount.providers.google',\n]\n\nSITE_ID = 1 # Must be set to 1 for allauth to function correctly\n\nAUTHENTICATION_BACKENDS = [\n    'django.contrib.auth.backends.ModelBackend', # Required for Django admin\n    'allauth.account.auth_backends.AuthenticationBackend', # allauth specific backend\n]\n\n# Required context processor for allauth templates\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [os.path.join(BASE_DIR, 'templates')],\n        'APP_DIRS': True,\n        'OPTIONS': {\n            'context_processors': [\n                'django.template.context_processors.debug',\n                'django.template.context_processors.request',\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n            ],\n        },\n    },\n]\n\n# allauth specific settings\nACCOUNT_EMAIL_REQUIRED = True\nACCOUNT_USERNAME_REQUIRED = False\nACCOUNT_SIGNUP_EMAIL_ENTER_WITHOUT_REQUEST = True # Enable instant signup with email\nACCOUNT_AUTHENTICATION_METHOD = 'email' # Allow login with email, not username\nACCOUNT_EMAIL_VERIFICATION = 'mandatory' # Or 'optional', 'none'\nACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 1 # How long email verification links are valid\nLOGIN_REDIRECT_URL = '/'\nACCOUNT_LOGOUT_REDIRECT_URL = '/'\n\n# Add allauth middleware\nMIDDLEWARE = [\n    # ... other middlewares\n    'allauth.account.middleware.AccountMiddleware',\n]\n\n# For testing email in development\nif os.environ.get('DJANGO_SETTINGS_MODULE') == 'your_project.settings': # Example check\n    EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'\n\n# urls.py (in your project's main urls.py)\nfrom django.contrib import admin\nfrom django.urls import path, include\n\nurlpatterns = [\n    path('admin/', admin.site.urls),\n    path('accounts/', include('allauth.urls')),\n    # ... other paths\n]\n","lang":"python","description":"To quickly set up `django-allauth`, first add the necessary apps (`django.contrib.sites`, `allauth`, `allauth.account`, and optionally `allauth.socialaccount` and providers) to your `INSTALLED_APPS`. Configure `SITE_ID=1`. Update `AUTHENTICATION_BACKENDS` to include `allauth.account.auth_backends.AuthenticationBackend`. Ensure `django.template.context_processors.request` is in `TEMPLATES`. Add `allauth.account.middleware.AccountMiddleware` to `MIDDLEWARE`. Finally, include `allauth.urls` in your project's `urls.py` under the `/accounts/` path. Basic settings for email authentication and redirection are also common. Remember to run `python manage.py makemigrations` and `python manage.py migrate` after configuration."},"warnings":[{"fix":"You must explicitly configure IP detection in your `settings.py` by setting `ALLAUTH_TRUSTED_PROXY_COUNT` (number of proxies in front of Django) or `ALLAUTH_TRUSTED_CLIENT_IP_HEADER` (e.g., 'HTTP_CF_CONNECTING_IP' for Cloudflare) to match your deployment architecture. Failing to do so will likely break rate limiting.","message":"Starting with version 65.14.2, IP address detection for rate limiting no longer trusts the `X-Forwarded-For` header by default due to security concerns.","severity":"breaking","affected_versions":"65.14.2+"},{"fix":"Before upgrading `django-allauth`, ensure your Python version is >=3.10 and your Django version is >=4.2 LTS (or 5.0+ for the latest allauth versions). Refer to the official compatibility matrix for exact requirements.","message":"Support for older Python and Django versions has been progressively dropped. Version 64.x dropped Python 3.7 support (requiring 3.8+), and version 65.15.0 dropped Python 3.8 and 3.9 support. Version 63.x dropped Django 3.2 support (requiring Django 4.2+).","severity":"breaking","affected_versions":"63.x, 64.x, 65.15.0+"},{"fix":"Review your custom `allauth` templates. It is recommended to migrate them to use the new element-based system. Alternatively, for a quick fix, ensure your `TEMPLATES` settings do not automatically discover `allauth` templates before your custom ones, allowing your overrides to take precedence.","message":"Version 64.x introduced significant changes to the template system, moving towards an element-based styling approach. Custom templates might not render correctly or benefit from new features.","severity":"breaking","affected_versions":"64.x+"},{"fix":"Do not use `django.contrib.sessions.backends.signed_cookies` as your `SESSION_ENGINE` if you are using `django-allauth`. It stores secrets (like verification codes) in the session, and signed cookies do not encrypt the data, making it insecure.","message":"`django-allauth` is explicitly NOT compatible with `SESSION_ENGINE` set to `django.contrib.sessions.backends.signed_cookies`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If you use social logins, ensure you install `django-allauth` using `pip install \"django-allauth[socialaccount]\"` (and specific provider extras if needed, e.g., `[socialaccount,github]`). Update your `requirements.txt` or `pyproject.toml` accordingly.","message":"As of version 65.3.1, social account functionality requires installing `django-allauth` with the `[socialaccount]` extra. A basic `pip install django-allauth` will no longer include social account dependencies.","severity":"breaking","affected_versions":"65.3.1+"},{"fix":"If you rely on these providers and need existing accounts to link, you will need to manually migrate `SocialAccount.uid` based on the `sub` field in `SocialAccount.extra_data`, or if certain of your use case, set `\"uid_field\": \"preferred_username\"` in the relevant `SocialApp.settings`.","message":"For Okta and NetIQ providers (65.13.0+), the identifier field for `SocialAccount.uid` was switched from `preferred_username` to `sub` due to `preferred_username` being mutable.","severity":"breaking","affected_versions":"65.13.0+"}],"env_vars":null,"search_vec":"'account':21,28,66 'account-manag':65 'activ':32 'aim':46 'align':38 'allauth':3,6 'applic':13 'approach':51 'authent':19,29,57,60,71 'comprehens':16 'django':2,5,12,41,59 'django-allauth':1,4 'factor':70 'flow':58 'frequent':35 'integr':9 'local':54 'login':63 'maintain':33 'manag':22,67 'multi':69 'multi-factor-authent':68 'new':40 'offer':48 'often':37 'parti':26 'provid':15 'python':43 'registr':20,64 'releas':36 'set':10 'social':27,56,62 'social-login':61 'solut':17 'third':25 'third-parti':24 'unifi':50 'version':44","created_at":"2026-04-11T01:29:37.210450+00:00","updated_at":"2026-04-16T14:27:35.525472+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"65.19.1","cli_name":"","cli_version":null,"type":"library","homepage":"https://allauth.org","github":"https://github.com/sponsors/pennersr","docs":"https://docs.allauth.org/en/latest/","changelog":"https://codeberg.org/allauth/django-allauth/src/branch/main/ChangeLog.rst","pypi":"https://pypi.org/project/django-allauth/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-08-28","next_check":"2026-07-30","install_tag":null}}