django-trench
E-mail
SMS / text
3rd party mobile apps
Features
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
Supported versions
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
Quick Start
Install the package using pip:
pip install django-trench
or add it to your requirements file.
Add trench library 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
Translation
Trench uses Transifex service to translate our package into other languages.
We will appreciate your help with translation.
https://www.transifex.com/merixstudio/django-trench/dashboard/
Local development
Clone the repo.
Crete virtual environment named e.g.
.venv:virtualenv .venvActivate the virtual environment:
source .venv/bin/activateInstall dependencies:
pip install black mypy pip install -r testproject/requirements.txtSet environment variables:
export PYTHONPATH=./testproject export DJANGO_SETTINGS_MODULE=settings export SECRET_KEY=YOURsecretGOEShereCreate a symbolic link to the
trench/module inside thetestproject/directory to emulate thetrenchpackage being installed.# make sure you run this command from the root directory of this project ln -s $(pwd)/trench/ $(pwd)/testproject/trenchCheck 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.
- [OPTIONAL] To make the tests run faster you can try to execute them in parallel.
To do so you need to install the
pytest-xdistpackage and run the tests with additional parameter of-n 8where8stands for the number of threads that will be spawned for executing the tests. Depending on the machine you’re using using this tool can speed up the test execution process up to 5 times.pytest -n 8 --cov=testproject/trench testproject/tests/
Release files for django-trench 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-trench-0.3.1.tar.gz | 29.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_trench-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.2 kB
Release files / django-trench-0.3.1.tar.gz
| Download URL | django-trench-0.3.1.tar.gz |
|---|---|
| Size | 29.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee667681b62c3ab057754419e15c68df93556e586781e4382277ec094e2bc2aa
|
|
BLAKE2b-256 checksum How to use checksums |
0320e0557b1c8b57a05070aa237006055d33267c4f9356d0ca508c7e58d1fe14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.13
|
Release files / django_trench-0.3.1-py3-none-any.whl
| Download URL | django_trench-0.3.1-py3-none-any.whl |
|---|---|
| Size | 37.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1bca8eec1900187f8e5b7b6c63adfa5714258a41d8bdb83d1bee12645cc0cadf
|
|
BLAKE2b-256 checksum How to use checksums |
be9e70e0b3b4efcbe77988a083457fc6e64b87fae925fb623ce8e07382cf03e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.13
|