skillfed

django-allauth-2fa

Adds two factor authentication to django-allauth

django-allauth-2fa v0.12.0 91.3K downloads/30d#13,529 on PyPI218
Permissive license Active released

What it is and what it does

django-allauth-2fa is a Django application that backports two-factor authentication to older versions of django-allauth (before 0.58.0). It integrates with django-allauth's authentication and account management system to add a second verification layer, supporting both time-based authenticator apps (displayed via QR code) and single-use backup codes for account recovery. The package depends on django-allauth, django-otp for OTP handling, Django itself, and qrcode for QR code generation.

The package is explicitly intended as a stopgap for projects stuck on older django-allauth versions. If you are using django-allauth 0.56.0 or newer, the project's maintainers recommend using django-allauth's built-in MFA support instead. The package maintains compatibility with Django 4.1–4.2 and Python 3.8–3.11, and is actively maintained but in a limited capacity given its deprecated status for newer allauth versions.

Use it for:

  • Add 2FA to a Django project using django-allauth < 0.58.0 without upgrading allauth.
  • Provide users with authenticator app support (TOTP) via QR code enrollment.
  • Generate and manage single-use backup codes for account recovery in case of lost authenticator.
  • Extend django-allauth's authentication workflow with a second verification factor for security-sensitive applications.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds two-factor authentication to django-allauth versions older than 0.58.0, supporting authenticator apps via QR code and single-use backup codes.

Yes, if you are locked on django-allauth < 0.58.0 and need 2FA now. Low install friction, active maintenance, and no known vulnerabilities. However, strongly prefer upgrading to django-allauth 0.58.0+ and using its built-in MFA support if your project timeline allows—this package is a temporary bridge, not a long-term solution.

Install

django-allauth-2fa on PyPI

pip

pip install django-allauth-2fa

uv

uv add django-allauth-2fa

poetry

poetry add django-allauth-2fa

Installing django-allauth-2fa

Before you install

Low install friction with a pure Python wheel. Actively maintained as of July 2026 with 218 repository stars. Note: the package is explicitly deprecated for django-allauth versions 0.58.0 and newer, which have built-in MFA support—verify your django-allauth version before installing.

License in practice

Licensed under Apache Software License (permissive). No restrictions on commercial or private use.

Quickstart

pip install django-allauth-2fa

from django_allauth_2fa.views import setup_2fa
# Add to Django urlpatterns and configure django-allauth, django-otp, and qrcode in settings

Requires django-allauth < 0.58.0; incompatible with newer versions that have built-in MFA. Requires Django 4.1 or 4.2 and Python 3.8–3.11 per documented compatibility matrix.

Verify before relying

  • Whether the package works with Python versions beyond 3.11 or Django versions beyond 4.2.
  • Current maintenance cadence and response time for bug reports or security issues.
  • Whether the QR code generation and backup code workflows are production-ready for all use cases.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 4 — django-allauth, django-otp, django, qrcode
Maintenance actively maintained — 575 days since the last release
Last repo commit
First released
Downloads 91,283/month — #13,529 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_allauth_2fa-0.12.0-py3-none-any.whl

Keywords: 2fa, allauth, auth, authentication, django, factor, otp, two

Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.1Framework :: Django :: 4.2Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: InternetTopic :: Software Development :: Libraries :: Python Modules

Tags

django two-factor authenticationdjango 2fa setupdjango allauth mfa addondjango otp integrationdjango authenticator app supportdjango backup codesdjango qr code authentication
django-authotp-totplegacy-support

More Python Modules packages