This page documents breaking changes that may require code updates when upgrading django-allauth. Always review these changes before upgrading to a new major version.
Breaking changes can affect your application’s functionality. Test thoroughly in a staging environment before deploying to production.
What Changed: The default IP address detection no longer trusts X-Forwarded-For header.Impact: Rate limiting may not work correctly if not configured properly.Required Action: Configure IP detection for your deployment architecture.
settings.py
# Choose one of these approaches:# Option 1: Configure proxy countALLAUTH_TRUSTED_PROXY_COUNT = 1 # Number of proxies in front of Django# Option 2: Use a trusted headerALLAUTH_TRUSTED_CLIENT_IP_HEADER = "HTTP_CF_CONNECTING_IP"# Option 3: Override in adapterclass MyAccountAdapter(DefaultAccountAdapter): def get_client_ip(self, request): return request.META.get('HTTP_CF_CONNECTING_IP')
What Changed: Python 3.8+ is now required.Impact: Applications running on Python 3.7 or earlier cannot use django-allauth 64.x+.Required Action: Upgrade to Python 3.8 or higher before upgrading django-allauth.
What Changed: Introduction of element-based styling system.Impact: Custom templates may need updates to use the new system.Migration Path:Option 1: Adopt New System (Recommended)
settings.py
# Use new element-based templatesTEMPLATES = [ { 'DIRS': [BASE_DIR / 'templates'], # ... },]
Create element overrides:
templates/allauth/elements/button.html
<button class="btn btn-primary" type="{{ type }}"> {{ content }}</button>
Option 2: Continue with Legacy Templates
settings.py
# Keep using your existing custom templates# No configuration needed if templates already exist
What Changed: Django 4.2+ is now required.Impact: Projects on Django 3.2 or earlier need to upgrade Django first.Required Action: Upgrade to Django 4.2 LTS before upgrading django-allauth.
What Changed: MFA models were restructured for better extensibility.Impact: Custom MFA implementations need updates.Required Action: Run migrations and update custom MFA code.
python manage.py migrate allauth
If you have custom MFA authenticators:
# Old (59.x)from allauth.mfa.models import TOTPDevice# New (60.x)from allauth.mfa.models import Authenticatorauthenticator = Authenticator.objects.filter( user=user, type=Authenticator.Type.TOTP).first()
Some adapter methods have been updated. Check if you override any:
class MyAccountAdapter(DefaultAccountAdapter): # New in 65.x - must implement if using rate limiting def get_client_ip(self, request): return request.META.get('REMOTE_ADDR') # Updated signature in 64.x def save_user(self, request, user, form, commit=True): # New parameter: commit user = super().save_user(request, user, form, commit=commit) return user
Signal Handlers
Signal arguments remain backward compatible, but new parameters added:
from allauth.account.signals import user_signed_up@receiver(user_signed_up)def on_user_signed_up(sender, request, user, **kwargs): # Always use **kwargs to handle new parameters in future versions sociallogin = kwargs.get('sociallogin') if sociallogin: # Handle social signup pass