- Clone project:
git clone https://github.com/anisimovih/DjangoJWTEmailBarebone
- Setup empty python virtual environment
virtualenv -p python3.8 .venv
source .venv/bin/activate
- Install project requirements to your local virtual environment:
pipenv install --dev
-
Create .env file with your local settings containing:
- SECRET_KEY
- HOST_IP
- HOSTNAME
- DATABASE_NAME
- DATABASE_HOST
- DATABASE_PORT
- DATABASE_USER
- DATABASE_PASS
- DATABASE_CONN_MAX_AGE
- SIGNING_KEY
- VERIFYING_KEY
-
Import vars from .env file:
export $(cat .env | xargs)
- Migrate database scheme:
python manage.py migrate
python manage.py createsuperuser
- Start server:
python manage.py runserver 127.0.0.1:8000
- Run tests to make sure everything is installed correctly:
./manage.py test
./flake-test.sh
-
Go to url: http://127.0.0.1:8000/swagger/
-
Try using the
/api/health_private/
endpoint. Your request must be denied because you are not authorized: -
Use your email and password in
/api/auth/token/
endpoint to get a JWT access token: -
Click the authorization button at top right corner and paste value as
Bearer {access_token}
: -
Try using the
/api/health_private/
endpoint again. Now you should get a response: