Authentication based on Json Web Token or synonym JWT.
In this repository I tried to create a jwt based authentication with django rest framework or DRF .
Install packages in requirement.txt
command : pip install -r requirement.txt
First i created a Custom model User for register User and config in settings with AUTH_USER_MODEL .
Second stage User must log in for continue in site so send request to endpoint or url '/api/accounts/login/' and enter email and password valid .
Then with package djangorestframework-simplejwt create a jwt token contains refresh token and access token .
These tokens contain a LifeTime that is set in the settings in the SIMPLE_JWT variable.
Authentication Default RestFramework changed to JWTAuthentication in settings in variable REST_FRAMEWORK .
For Change Password User you must login Before, so i used Permission IsAuthenticated in this View.
IsAuthenticated checks the header for an access token, returning an error if invalid.
if validated everything's your password successfully changed and in this view used method PUT .