Skip to content

NaderFarhat/django-rest-api

Repository files navigation

Rest API using Django, Django rest framework

About The Project

This project contains the implementation of the Celero Challenge Back-End, using Django and Django REST Framework. The project is deployed in Heroku safe-reef-79435

Built With

Setup

Install the depencies

git clone https://github.com/NaderFarhat/django-rest-api.git
pip install -r requirements.txt

Migrate the database

python manage.py makemigrations
python manage.py migrate

Populate the database

python manage.py shell
>>> exec(open('import_data_csv.py').read())

Start the server

python manage.py runserver

Run the tests

python manage.py tests

API endpoints

Comitee

Method Url Description
GET https://safe-reef-79435.herokuapp.com/api/events/com/ List all comitees
GET https://safe-reef-79435.herokuapp.com/api/events/com/(:id) Info of one comitee.
POST https://safe-reef-79435.herokuapp.com/api/events/com/ Create new comitee
PATCH https://safe-reef-79435.herokuapp.com/api/events/com/(:id) Update comitee.
PUT https://safe-reef-79435.herokuapp.com/api/events/com/(:id) Update comitee(all)
DELETE https://safe-reef-79435.herokuapp.com/api/events/com/(:id) Delete comitee.

Event

Method Url Description
GET https://safe-reef-79435.herokuapp.com/api/events/evt/ List all Events
GET https://safe-reef-79435.herokuapp.com/api/events/evt/(:id) Info of one Event.
POST https://safe-reef-79435.herokuapp.com/api/events/evt/ Create new Event
PATCH https://safe-reef-79435.herokuapp.com/api/events/evt/(:id) Update Event.
PUT https://safe-reef-79435.herokuapp.com/api/events/evt/(:id) Update Event(all)
DELETE https://safe-reef-79435.herokuapp.com/api/events/evt/(:id) Delete Event.

Athlete

Method Url Description
GET https://safe-reef-79435.herokuapp.com/api/events/ath/ List all Athlete
GET https://safe-reef-79435.herokuapp.com/api/events/ath/(:id) Info of one Athlete.
POST https://safe-reef-79435.herokuapp.com/api/events/ath/ Create new Athlete
PATCH https://safe-reef-79435.herokuapp.com/api/events/ath/(:id) Update Athlete.
PUT https://safe-reef-79435.herokuapp.com/api/events/ath/(:id) Update Athlete(all)
DELETE https://safe-reef-79435.herokuapp.com/api/events/ath/(:id) Delete Athlete.

Filtering Attributes

Example

  • safe-reef-79435.herokuapp.com/api/events/ath/?name=Arvi+Aavik