Follow the steps below to run this project:
-
Make sure you have the following development environment:
- Python 3.9.7 (You can be flexible with the version but, I have tested with this version only).
- Any IDE or text editor of your choice.
- Access to Command-Line or Terminal
-
Clone this repository.
-
Open the terminal or command line.
-
Navigate to the location where you cloned this repository.
-
Install the dependencies by typing following command:
pip install -r requirements.txt
-
Migrate Django models to the database (SQLite) by typing following commands in order:
python manage.py makemigrations
python manage.py migrate
-
Run the Django server by entering following commands in order:
python manage.py runserver
Now, the project should be up and running. By default django server runs in localhost:8000 and you should be able to access the GraphiQL interface by typing http://localhost:8000/graphql address in the address bar of the browser.
To connect with this API locally, you might need to disable cors. Follow these steps mentioned in https://www.stackhawk.com/blog/django-cors-guide/ for this purpose: