django-mail-auth


Namedjango-mail-auth JSON
Version 3.3.0 PyPI version JSON
download
home_pageNone
SummaryDjango authentication via login URLs, no passwords required.
upload_time2024-10-09 21:05:52
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords django otp email authentication passwordless
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ================
Django Mail Auth
================

|version| |docs| |coverage| |license|

.. figure:: sample.png
    :width: 425
    :alt: screenshot from a login form

Django Mail Auth is a lightweight authentication backend for Django,
that does not require users to remember passwords.

Django Mail Auth features:

- custom user model support
- drop in Django admin support
- drop in Django User replacement
- drop in Wagtail login replacement
- extendable SMS support

This project was inspired by:

- `Is it time for password-less login?`_ by `Ben Brown`_
- `LOGIN WITHOUT PASSWORD MOST SECURE | WAIT.. WHAT?`_ by `Joris Snoek`_
- `django-nopassword`_ by `Rolf Erik Lekang`_


.. _`Rolf Erik Lekang`: http://rolflekang.com
.. _`django-nopassword`: https://github.com/relekang/django-nopassword
.. _`Is it time for password-less login?`: http://notes.xoxco.com/post/27999787765/is-it-time-for-password-less-login
.. _`LOGIN WITHOUT PASSWORD MOST SECURE | WAIT.. WHAT?`: https://www.lucius.digital/en/blog/login-without-password-most-secure-wait-what
.. _`Ben Brown`: http://twitter.com/benbrown
.. _`Joris Snoek`: https://twitter.com/lucius_digital

Installation
------------

Run this command to install ``django-mail-auth``::

    python3 -m pip install django-mail-auth[wagtail]

Setup
-----

First add ``mailauth`` to you installed apps:

.. code-block:: python

    INSTALLED_APPS = [
        # Django's builtin apps…

        'mailauth',

        'mailauth.contrib.admin',  # optional
        'mailauth.contrib.user',  # optional

        # optional, must be included before "wagtail.admin"
        'mailauth.contrib.wagtail',


        # other apps…
    ]

``mailauth.contrib.admin`` is optional and will replace the admin's login
with token based authentication too.

``mailauth.contrib.user`` is optional and provides a new Django User model.
The new User model needs to be enabled via the ``AUTH_USER_MODEL`` setting:

.. code-block:: python

    # This setting should be either "EmailUser" or
    # any custom subclass of "AbstractEmailUser"
    AUTH_USER_MODEL = 'mailauth_user.EmailUser'

    # optional, Wagtail only
    WAGTAILUSERS_PASSWORD_ENABLED = False


Next you will need to add the new authentication backend:

.. code-block:: python

    AUTHENTICATION_BACKENDS = (
        # default, but now optional
        # This should be removed if you use mailauth.contrib.user or any other
        # custom user model that does not have a username/password
        'django.contrib.auth.backends.ModelBackend',

        # The new access token based authentication backend
        'mailauth.backends.MailAuthBackend',
    )

Django's ``ModelBackend`` is only needed, if you still want to support
password based authentication. If you don't, simply remove it from the list.

Last but not least, go to your URL root configuration ``urls.py`` and add the following:

.. code-block:: python

    from django.urls import path


    urlpatterns = [
        path('accounts/', include('mailauth.urls')),

        # optional, must be before "wagtail.admin.urls"
        path('', include('mailauth.contrib.wagtail.urls')),
    ]

That's it!

.. note:: Don't forget to setup you Email backend!

.. |version| image:: https://img.shields.io/pypi/v/django-mail-auth.svg
   :target: https://pypi.python.org/pypi/django-mail-auth/
.. |coverage| image:: https://codecov.io/gh/codingjoe/django-mail-auth/branch/main/graph/badge.svg
   :target: https://codecov.io/gh/codingjoe/django-mail-auth
.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg
   :target: :target: https://raw.githubusercontent.com/codingjoe/django-mail-auth/main/LICENSE
.. |docs| image:: https://readthedocs.org/projects/django-mail-auth/badge/?version=latest
   :target: https://django-mail-auth.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "django-mail-auth",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "django, otp, email, authentication, passwordless",
    "author": null,
    "author_email": "Johannes Maron <johannes@maron.family>",
    "download_url": "https://files.pythonhosted.org/packages/d5/52/61edfd24647183e4bf69a17a770aa0946d8bbc6af84cc95793bca0c27074/django_mail_auth-3.3.0.tar.gz",
    "platform": null,
    "description": "================\nDjango Mail Auth\n================\n\n|version| |docs| |coverage| |license|\n\n.. figure:: sample.png\n    :width: 425\n    :alt: screenshot from a login form\n\nDjango Mail Auth is a lightweight authentication backend for Django,\nthat does not require users to remember passwords.\n\nDjango Mail Auth features:\n\n- custom user model support\n- drop in Django admin support\n- drop in Django User replacement\n- drop in Wagtail login replacement\n- extendable SMS support\n\nThis project was inspired by:\n\n- `Is it time for password-less login?`_ by `Ben Brown`_\n- `LOGIN WITHOUT PASSWORD MOST SECURE | WAIT.. WHAT?`_ by `Joris Snoek`_\n- `django-nopassword`_ by `Rolf Erik Lekang`_\n\n\n.. _`Rolf Erik Lekang`: http://rolflekang.com\n.. _`django-nopassword`: https://github.com/relekang/django-nopassword\n.. _`Is it time for password-less login?`: http://notes.xoxco.com/post/27999787765/is-it-time-for-password-less-login\n.. _`LOGIN WITHOUT PASSWORD MOST SECURE | WAIT.. WHAT?`: https://www.lucius.digital/en/blog/login-without-password-most-secure-wait-what\n.. _`Ben Brown`: http://twitter.com/benbrown\n.. _`Joris Snoek`: https://twitter.com/lucius_digital\n\nInstallation\n------------\n\nRun this command to install ``django-mail-auth``::\n\n    python3 -m pip install django-mail-auth[wagtail]\n\nSetup\n-----\n\nFirst add ``mailauth`` to you installed apps:\n\n.. code-block:: python\n\n    INSTALLED_APPS = [\n        # Django's builtin apps\u2026\n\n        'mailauth',\n\n        'mailauth.contrib.admin',  # optional\n        'mailauth.contrib.user',  # optional\n\n        # optional, must be included before \"wagtail.admin\"\n        'mailauth.contrib.wagtail',\n\n\n        # other apps\u2026\n    ]\n\n``mailauth.contrib.admin`` is optional and will replace the admin's login\nwith token based authentication too.\n\n``mailauth.contrib.user`` is optional and provides a new Django User model.\nThe new User model needs to be enabled via the ``AUTH_USER_MODEL`` setting:\n\n.. code-block:: python\n\n    # This setting should be either \"EmailUser\" or\n    # any custom subclass of \"AbstractEmailUser\"\n    AUTH_USER_MODEL = 'mailauth_user.EmailUser'\n\n    # optional, Wagtail only\n    WAGTAILUSERS_PASSWORD_ENABLED = False\n\n\nNext you will need to add the new authentication backend:\n\n.. code-block:: python\n\n    AUTHENTICATION_BACKENDS = (\n        # default, but now optional\n        # This should be removed if you use mailauth.contrib.user or any other\n        # custom user model that does not have a username/password\n        'django.contrib.auth.backends.ModelBackend',\n\n        # The new access token based authentication backend\n        'mailauth.backends.MailAuthBackend',\n    )\n\nDjango's ``ModelBackend`` is only needed, if you still want to support\npassword based authentication. If you don't, simply remove it from the list.\n\nLast but not least, go to your URL root configuration ``urls.py`` and add the following:\n\n.. code-block:: python\n\n    from django.urls import path\n\n\n    urlpatterns = [\n        path('accounts/', include('mailauth.urls')),\n\n        # optional, must be before \"wagtail.admin.urls\"\n        path('', include('mailauth.contrib.wagtail.urls')),\n    ]\n\nThat's it!\n\n.. note:: Don't forget to setup you Email backend!\n\n.. |version| image:: https://img.shields.io/pypi/v/django-mail-auth.svg\n   :target: https://pypi.python.org/pypi/django-mail-auth/\n.. |coverage| image:: https://codecov.io/gh/codingjoe/django-mail-auth/branch/main/graph/badge.svg\n   :target: https://codecov.io/gh/codingjoe/django-mail-auth\n.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg\n   :target: :target: https://raw.githubusercontent.com/codingjoe/django-mail-auth/main/LICENSE\n.. |docs| image:: https://readthedocs.org/projects/django-mail-auth/badge/?version=latest\n   :target: https://django-mail-auth.readthedocs.io/en/latest/?badge=latest\n   :alt: Documentation Status\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Django authentication via login URLs, no passwords required.",
    "version": "3.3.0",
    "project_urls": {
        "Changelog": "https://github.com/codingjoe/django-mail-auth/releases",
        "Documentation": "https://django-mail-auth.rtfd.io/",
        "Issue-Tracker": "https://github.com/codingjoe/django-mail-auth/issues",
        "Project-URL": "https://github.com/codingjoe/django-mail-auth",
        "Source": "https://github.com/codingjoe/django-mail-auth"
    },
    "split_keywords": [
        "django",
        " otp",
        " email",
        " authentication",
        " passwordless"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "919e3675c88e3da6816a73842d57eadd2833c79eff1debae3ee4daea1d0e8008",
                "md5": "49b8451c1068670ffb26fa7bad0f6aaa",
                "sha256": "78bde84be83f1018040ba8139a3f9080582158a7fb3eb47b021a31dd1bf93664"
            },
            "downloads": -1,
            "filename": "django_mail_auth-3.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "49b8451c1068670ffb26fa7bad0f6aaa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 25278,
            "upload_time": "2024-10-09T21:05:50",
            "upload_time_iso_8601": "2024-10-09T21:05:50.898596Z",
            "url": "https://files.pythonhosted.org/packages/91/9e/3675c88e3da6816a73842d57eadd2833c79eff1debae3ee4daea1d0e8008/django_mail_auth-3.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d55261edfd24647183e4bf69a17a770aa0946d8bbc6af84cc95793bca0c27074",
                "md5": "6fa95325d2d1c50c223ae228af15526d",
                "sha256": "c2d87e14fc7a0da058ebb9b0b00820ad5361ea72797059b20d1de0d2f2eaa504"
            },
            "downloads": -1,
            "filename": "django_mail_auth-3.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6fa95325d2d1c50c223ae228af15526d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 17231,
            "upload_time": "2024-10-09T21:05:52",
            "upload_time_iso_8601": "2024-10-09T21:05:52.692734Z",
            "url": "https://files.pythonhosted.org/packages/d5/52/61edfd24647183e4bf69a17a770aa0946d8bbc6af84cc95793bca0c27074/django_mail_auth-3.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-09 21:05:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "codingjoe",
    "github_project": "django-mail-auth",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "django-mail-auth"
}
        
Elapsed time: 4.83641s