- Clone this project:
git clone https://github.com/SeanOverton/django-csit314.git
- [OPTIONAL but recommended] Recommend that you create and activate a virtual env in your terminal here before running the pip install. This process will vary depending on OS so please look into it before you try this: https://docs.python.org/3/library/venv.html#:~:text=A%20virtual%20environment%20is%20a,part%20of%20your%20operating%20system.
- Install dependencies:
pip install -r requirements.txt
- Run
python -c "import secrets; print(secrets.token_urlsafe())"
to generate a secret key. - Copy the contents of .env-EXAMPLE and add your secret key generated from the last command into this file. Save this file as .env in the root directory.
File contents should look like
DJANGO_SECRET_KEY=<your_secret_key>
python manage.py makemigrations
python manage.py migrate
- Run the server locally:
python manage.py runserver
- python manage.py createsuperuser
- This will prompt you for user details. Complete this and remember these details.
- Navigate to: http://localhost:8000/admin/ to login to the admin dashboard and access DB directly.
- Import PostmanRequestsCollection.json into Postman app.
- Send a sign up request.
- Send a login request.
- This will return a token that needs to be added to any of the other requests as a header to authenticate with the server.
Authorization: Token <your_token>
- Environment File Required.