Skip to main content

REST Multi-factor authentication package for Django

Project description

=============
django-trench
=============

.. image:: https://travis-ci.org/merixstudio/django-trench.svg?branch=master
:target: https://travis-ci.org/merixstudio/django-trench

.. image:: https://codecov.io/gh/merixstudio/django-trench/branch/master/graph/badge.svg
:target: https://codecov.io/gh/merixstudio/django-trench/

.. image:: https://readthedocs.org/projects/django-trench/badge/?version=latest
:target: https://django-trench.readthedocs.io/en/latest/?badge=latest


| **django-trench** provides a set of REST API endpoints to supplement `django-rest-framework`_ with multi-factor authentication (MFA, 2FA). It supports both standard built-in authentication methods, as well as JWT (JSON Web Token). **django-trench** follows the url pattern developed in `djoser`_ library and may act as its supplement.
| We deliver a couple of sample secondary authentication methods including sending OTP based code by email, SMS/text as well as through 3rd party mobile apps. Developers can easily add own auth backend supporting any communication channel.

Features
--------

* Easily plugable and compatible with `django-rest-framework`_ and `djoser`_
* Allows user to pick an additional authentication method from range of backends defined by a developer. Read more: `backends`_.
* Comes out of a box with email, SMS add mobile apps support

Requirements
------------

Supported versions
*******************
* Python 3.4, 3.5, 3.6, 3.7
* Django 1.11, 2.0, 2.1
* Django REST Framework 3.8

| If you implement ``djoser`` for authentication:
* `djoser`_ 1.15.0

| If you are going to use JWT authentication:
* `django-rest-framework-jwt`_ 1.11.0

Quick Start
-----------

1. Install the package using pip:

.. code-block:: python

pip install django-trench

or add it to your requirements file.

2. Add ``trench`` library to INSTALLED_APPS in your app settings file:

.. code-block:: python

INSTALLED_APPS = (
...,
'rest_framework',
'rest_framework.authtoken', # In case of implementing Token Based Authentication
...,
'trench',
)

3. Run migrations

| Read further in: `installation`_.

Demo project
------------

You can also check our `demo`_.

.. _backends: https://django-trench.readthedocs.io/en/latest/backends.html
.. _installation: https://django-trench.readthedocs.io/en/latest/installation.html
.. _demo: https://django-trench.readthedocs.io/en/latest/demo.html
.. _django-rest-framework: http://www.django-rest-framework.org
.. _djoser: https://github.com/sunscrapers/djoser
.. _django-rest-framework-jwt: https://github.com/GetBlimp/django-rest-framework-jwt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-trench-0.1.0.tar.gz (24.3 kB view details)

Uploaded Source

File details

Details for the file django-trench-0.1.0.tar.gz.

File metadata

  • Download URL: django-trench-0.1.0.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for django-trench-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c2fc8293dfbbe3dcb43480c6685cf590fe3d18f9b27ccf4d90539c810d39a36
MD5 98b8acb5f3ba99ad30e534f52a017796
BLAKE2b-256 b2e08dc8eefe233e2ad86f0dc192cc67ab094e777bee499223f6ceaae352f1ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page