Skip to main content

This library is a fork of the popular django-rest-auth library, with some customizations and additional features added to suit my specific use case.

Project description

Django Rest Auth!

This library is a fork of the popular django-rest-auth library, with some customizations and additional features added to suit my specific use case.

Features

  • User registration and authentication using email and password
  • User management (view, update, and delete)
  • Token-based authentication
  • Password reset and change functionality
  • Social authentication (e.g. Facebook, Google)

Installation

To install this library, simply run the following command: Copy code

pip install git+https://github.com/saqib-devops/django-rest-auth-exarth-version.git
-------------------------OR-------------------------------------
pip install exarth-rest-auth

Usage

To use this library in your Django project, follow these steps:

  • Add exarth_rest_auth to your INSTALLED_APPS in settings.py
INSTALLED_APPS = [
    'exarth_rest_auth',
    'exarth_rest_auth.registration'
]
  • Add the library's URLs to your urls.py:
urlpatterns += [
    re_path(r'^rest-auth/', include('exarth_rest_auth.urls')),
    re_path(r'^rest-auth/registration/', include('exarth_rest_auth.registration.urls')),
]

JWT Support (JSON web token)

By default dj-rest-auth uses Django’s Token-based authentication. If you want to use JWT authentication, follow these steps:

pip Install djangorestframework-simplejwt

djangorestframework-simplejwt is currently the only supported JWT library.

Add a simple_jwt auth configuration to the list of authentication classes.

REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES':(
    'exarth_rest_auth.jwt_auth.JWTCookieAuthentication',
)
}

Add the following configuration value to your settings file to enable JWT authentication in dj-rest-auth.

REST_USE_JWT = True

Declare what you want the cookie key to be called. If you want to use the refresh token feature, also be sure to set that variable.

JWT_AUTH_COOKIE = 'my-app-auth'

JWT_AUTH_REFRESH_COOKIE = 'my-refresh-token'

This example value above will cause dj-rest-auth to return a Set-Cookie header that looks like this:

Set-Cookie: my-app-auth=xxxxxxxxxxxxx; expires=Sat, 28 Mar 2020 18:59:00 GMT; HttpOnly; Max-Age=300; Path=/

If JWT_AUTH_REFRESH_COOKIE is also set, it will also set a comparable cookie for that. JWT_AUTH_COOKIE is also used while authenticating each request against protected views.

Note

  • The remaining features are same as rest auth , the only difference is it support latest version of Django

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

exarth_rest_auth-1.0.3.tar.gz (42.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exarth_rest_auth-1.0.3-py3-none-any.whl (49.6 kB view details)

Uploaded Python 3

File details

Details for the file exarth_rest_auth-1.0.3.tar.gz.

File metadata

  • Download URL: exarth_rest_auth-1.0.3.tar.gz
  • Upload date:
  • Size: 42.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for exarth_rest_auth-1.0.3.tar.gz
Algorithm Hash digest
SHA256 47dfe73d29e8082fd4ee2ca9d1d2470de7ae420e7d8d8ef0cb52bea1dd080b58
MD5 eee50b8508835bde2a14962dce64be26
BLAKE2b-256 ee4c37c543510ad96b988e1e730b0d4e9c2387c5caf84f2b3b51717d3ae0f33d

See more details on using hashes here.

File details

Details for the file exarth_rest_auth-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for exarth_rest_auth-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d437a3f78ed7628b515db4f52a72c2573c5d80669c18bee79127d0321efed0b6
MD5 916dd97913c925dca2a55abb05d9d362
BLAKE2b-256 8ce65bd0a0bb9552f8b1a30e0c4df8875ae88092de4ff9c4fec9a4db32113f29

See more details on using hashes here.

Supported by

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