Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DRF auth

Django rest framework authentication system.

Features

  • Registration
  • Login
  • Logout
  • Users detail list
  • Single user detail
  • User update detail
  • Delete user
  • Change password
  • Check password

Getting started

$ git clone https://github.com/AmirAhrari/drf-auth.git && cd drf-auth
$ pip install -r requirements.txt
$ python manage.py migrate
$ python manage.py runserver

server has been started in http://localhost:8000/

Endpoints

Registration

Default URL: api/auth/register/
Method: POST
Inputs: username, email, password
Permissions: -
Response: id, username, email, password, token

Login

Default URL: api/auth/login/
Method: POST
Inputs: username, password
Permissions: -
Response: user, token

Logout

Default URL: api/auth/logout/
Method: POST
Inputs: -
Permissions: IsAuthenticated
Response: HTTP_200_OK

Users detail list

Default URL: api/auth/users/
Method: GET
Inputs: -
Permissions: -
Response: users list (id, username, email)

Single user detail

Default URL: api/auth/users/<user_id>/ OR api/auth/users/self/
Method: GET
Inputs: -
Permissions: -
Response: id, username, email

User update detail

Default URL: api/auth/users/<user_id>/ OR api/auth/users/self/
Method: PUT, PATCH
Inputs: username, email
Permissions: CurrentUserOrAdmin
Response: id, username, email

Delete user

Default URL: api/auth/users/<user_id>/ OR api/auth/users/self/
Method: DELETE
Inputs: -
Permissions: CurrentUserOrAdmin
Response: HTTP_204_NO_CONTENT

Change password

Default URL: api/auth/change-password/
Method: POST
Inputs: old_password, new_password
Permissions: IsAuthenticated
Response: HTTP_200_OK

Check password

Default URL: api/auth/check-password/
Method: POST
Inputs: password
Permissions: IsAuthenticated
Response: HTTP_200_OK

Todos

  • Reset password

About

Django rest framework authentication system

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages