A school REST API made with Django Rest Framework.
CRUD for Student entity: /students
CRUD for Course entity: /courses
CRUD for Enrollment entity: /enrollments
Method | Route | Description |
---|---|---|
GET | /student/{id}/enrollments |
Gets all enrollments of a student by {id} |
GET | /course/{id}/enrollments |
Gets all enrollments of a course by {id} |
You need to have Python 3.7.4+
Define the following envs:
SECRET_KEY
- The SECRET KEY for your Django project
Clone this repo and go to project root directory:
$ git clone https://github.com/willy-r/school-api-drf.git
$ cd school-api-drf
Create virtual enviroment and activate it:
$ python -m venv venv
$ source venv/bin/activate
Install dependencies:
$ (venv) pip install -r requirements.txt
Migrate database, create superuser and start server:
$ (venv) python manage.py migrate
$ (venv) python manage.py createsuperuser
$ ...
$ (venv) python manage.py runserver
Access API: