Django-REST-Framework-User-Registration-Authentication
Django-REST-Framework-User-Registration-Authentication copied to clipboard
Django app to register and authenticate user using REST API framework.
Django REST Framework - UserRegistration-Authentication
Django app to register and authenticate user using REST API framework.
How to use:
pip install -r requirements.txtpython manage.py runserver
URLs to target:
- to register a user
- localhost:8000/api/addUser/
- to login a user
- localhost:8000/api/login/
- to logout a user
- localhost:8000/api/logout/
API Call demo:
curl -X POST http://localhost:8000/api/addUser/ -d "[email protected]&password=abcd123&username=test"curl -X POST http://localhost:8000/api/login/ -d "[email protected]&password=abcd123"curl -X POST http://localhost:8000/api/logout/ -d "token=b75f9fc8-f598-4d4c-8698-d98ee808c1f3"
Note: token is generated using uuid package.
Useful commands:
python manage.py createsuperuserpython manage.py makemigrationspython manage.py migrate