Simple backend for the NTUSU Index Swapper MVP. For frontend devs, please refer to the steps below to run the server successfully.
Prerequisities:
Clone the repository
git clone https://github.com/michac789/ntusu-index-swapper-be.git
Change your directory inside of the project
cd ntusu-index-swapper-be
Install dependencies
pip install -r requirements.txt
You may want to use conda or venv to create a virtual environment for this project.
Migrate database
python manage.py migrate
Load sample data
Sample data will provides you will all of this:
Please refer to the fixtures
folder for the detail of the sample data.
python manage.py loaddata sample_user.json
python manage.py loaddata sample_course_index_small.json
python manage.py loaddata sample_swap_request_small.json
Note: Please run the above command in order! Also, run this command only once when you first setup the project. If you have added additional data, running this may cause an error. In that case, you might consider resetting the database before loading the sample data.
Run server
python manage.py runserver
The server should be running on localhost:8000
by default.
You can visit Django admin page at localhost:8000/admin
and login with the superuser account.
You can see the API documentation at localhost:8000/swagger
and test the API needed there.