Authentication and Registration in Django Rest Framework
Project description
Dj-Rest-Auth-Social
Drop-in API endpoints for handling authentication securely in Django Rest Framework. Works especially well with SPAs (e.g React, Vue, Angular), and Mobile applications.
Requirements
- Django 2 or 3
- Python 3
Quick Setup
Install package
pip install dj-rest-auth-social
Add dj_rest_auth
app to INSTALLED_APPS in your django settings.py:
INSTALLED_APPS = (
...,
'rest_framework',
'rest_framework.authtoken',
...,
'dj_rest_auth'
)
Add URL patterns
urlpatterns = [
path('dj-rest-auth/', include('dj_rest_auth.urls')),
]
(Optional) Use Http-Only cookies
REST_USE_JWT = True
JWT_AUTH_COOKIE = 'jwt-auth'
Testing
Install required modules with pip install -r dj_rest_auth/tests/requirements.pip
To run the tests within a virtualenv, run python runtests.py
from the repository directory.
The easiest way to run test coverage is with coverage
,
which runs the tests against all supported Django installs. To run the test coverage
within a virtualenv, run coverage run ./runtests.py
from the repository directory then run coverage report
.
Tox
Testing may also be done using tox
, which
will run the tests against all supported combinations of python and django.
Install tox, either globally or within a virtualenv, and then simply run tox
from the repository directory. As there are many combinations, you may run them
in parallel
using tox --parallel
.
The tox.ini
includes an environment for testing code coverage
and you can run it and view this report with tox -e coverage
.
Linting may also be performed via flake8
by running tox -e flake8
.
Documentation
View the full documentation here: https://dj-rest-auth.readthedocs.io/en/latest/index.html
Acknowledgements
This project began is a fork of dj-rest-auth. Big thanks to everyone who contributed to that repo!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dj-rest-auth-social-2.2.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9d0c993f1a01ab4e08262aa294f66f324c24a412c7232aa234fa313c219cbdd |
|
MD5 | c07dc320a6cf030a7f88d1948c86b7cb |
|
BLAKE2b-256 | 279f9ed219d849ca2622b2d821e10aaea74a2044caef8d478f0c6212138a2ddb |
Hashes for dj_rest_auth_social-2.2.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c986d164b21fd539cc74ace395f40cec7029e85d4f8ed9a13a96f881f70bf951 |
|
MD5 | c12fb0b33cb1c0dcd90e85ee021a7548 |
|
BLAKE2b-256 | 3f4da375c88480dc3a12f89fd3416036a9fe17413e6b966ffe8f158698236c08 |