This is a sample rest api using DjangoRestFramework for a university. It contains the models
- Students
- Degrees
- Cohorts
- Modules
- Grades
The system has been populated with dummy data from the file /university/management/commands/seed.py
To clear the database and rebuild with fresh random data use
python manage.py seed
Warning this command can take some time to run, it populates a lot of data
The superuser details are:
username: admin
password: testing123456
Clone the repo and run
python manage.py runserver
This will then run on your own machine at http://127.0.0.1:8000
If you have Docker installed have a DockerHub account you can download a docker image of this app by typing
docker pull scrineymvm/ca298restassignment:latest
To then start the image in a container run
docker run -p 8000:8000 --name ca298restassignment scrineymvm/ca298restassignment:latest
Then you can go to http://localhost:8000 to view the running instance
The homepage will take you straight to an interactive swagger interface
/api
will take you to the standard django rest framework api page/api/schema/redoc/
will take you to an interactive redoc page for the api/api/schema/
will allow you to download theschema.yml
to import into other tools such as postman
This app has allowed localhost:3000
through for CORS, if you need additional ports add them in restexample/settings.py
CORS_ALLOWED_ORIGINS = [
"http://localhost:3000", # node on port 3000
"http://127.0.0.1:3000" # node on port 3000
]