Basic social network API with JWT authentication based on Django REST Framework.
Create local_settings.py
next to settings.py
.
Set HUNTER_API_KEY
(https://hunter.io/api_keys) in local_settings.py
if you need to verify user email on register.
Set CLEARBIT_API_KEY
(https://dashboard.clearbit.com/api) in local_settings.py
to enrich user account with additional data on register.
pipenv --three
pipenv install --dev
python manage.py migrate
python manage.py collectstatic
python manage.py test
python manage.py runserver
Visit http://localhost:8000/swagger/
to check out available endpoints.
Comment out
HUNTER_API_KEY
inlocal_settings.py
if you are using fake email.
-
Try out
POST /users/
with email and password to create a new user. -
POST /api/token/
with the same credentials to obtain an auth token. -
Copy
access
token from a response body. -
Authorize with
Bearer <your_access_token>
to unlock the rest of the endpoints.