Need help with django-mfa?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

139 Stars 57 Forks MIT License 102 Commits 18 Opened issues


Django-mfa (Multi Factor Authentication) is a simple package to add extra layer of security to your django web application. It gives web app a randomly changing password as an extra protection and supports u2f too

Services available


Need anything else?

Contributors list


.. image:: :target: :alt: Documentation Status

.. image:: :target:

.. image:: :target: :alt: Latest Release

.. image:: :target:

.. image:: :target: :alt: Code Health

.. image:: :target:

Django-mfa(Multi-factor Authentication) is a simple django package to add extra layer of security to your web application. Django-mfa is providing easiest integration to enable Multi factor authentication to your django applications. Inspired by the user experience of Google's Authentication, django-mfa allows users to authenticate through text message(SMS) or by using token generator app like google authenticator.

We welcome your feedback on this package. If you run into problems, please raise an issue or contribute to the project by forking the repository and sending some pull requests.

This Package is compatible with Django versions >=1.10 (including at least Django 2.0.7) Documentation is available at readthedocs(

Quick start

Installation ~~~~~~~~~~~~

The Git repository can be cloned with this command::

git clone


package, included in the distribution, should be placed on the

Otherwise you can just

easy_install -Z django-mfa
pip install django-mfa

Settings ~~~~~~~~

  1. Add app name in

    INSTALLEDAPPS = [ '..................', 'djangomfa', '..................' ]

  2. Add 'django_mfa.middleware.MfaMiddleware' to your project middlewares::

    MIDDLEWARE = [ '....................................', 'django_mfa.middleware.MfaMiddleware', '....................................', ]

  3. Optional issuer name. This name will be shown in the Authenticator App along with the username

MFAISSUERNAME = "Cool Django App"

  1. Optionally enable remember-my-browser. If enabled, the browser will be trusted for specified number of days after the user enters the code once::


Urls ~~~~

Add the following to your root file.

.. code:: django

urlpatterns = [

url(r'^settings/', include('django_mfa.urls')),


Done. With these settings you have now, you will get the MFA features.

You can try it by hosting on your own or deploy to Heroku with a button click.

.. image:: :target:

Visit our Django web development page


We welcome your feedback and support, raise

github ticket
_ if you want to report a bug. Need new features?
Contact us here

.. _contact us here: .. _Here: .. _github ticket:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.