- SMS / text
- 3rd party mobile apps
- Easily pluggable and compatible with django-rest-framework
- 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, mobile apps and YubiKey support
- Python 3.7, 3.8, 3.9
- Django 2.0, 2.1, 2.2, 3.0
- Django REST Framework 3.10
- djangorestframework-simplejwt >= 4.3.0
- Install the package using pip:
pip install django-trench
or add it to your requirements file.
trenchlibrary to INSTALLED_APPS in your app settings file:
INSTALLED_APPS = ( ..., 'rest_framework', 'rest_framework.authtoken', # In case of implementing Token Based Authentication ..., 'trench', )
- Run migrations
Trench uses Transifex service to translate our package into other languages.
We will appreciate your help with translation.
You can also check our live demo.
Clone the repo.
Crete virtual environment named e.g.
Activate the virtual environment:
pip install pytest pytest-cov black flake8 isort mypy pip install -r testproject/requirements.txt
Set environment variables:
export PYTHONPATH=./testproject export DJANGO_SETTINGS_MODULE=settings export SECRET_KEY=YOURsecretGOEShere
django-trenchpackage distribution locally:
python setup.py sdist
This will create a
distdirectory and place a file named
x.x.xwill be replaced with the current package's version.
django-trenchpackage that you just built:
pip install dist/django-trench-x.x.x.tar.gz
Use the actual distribution file name, the one above is just an example.
Check whether the tests are passing:
pytest --cov=testproject/trench testproject/tests/
Remember - anytime you change something in the
django-trench source code you need to re-build and re-install
the package (steps 6-7) for the changes to be present during e.g. running the tests.