- Read the guideline before starting.
In this task, you should implement an API that provides CRUD operations for the Movie model.
- Create a Django project and a
cinemaapp inside it. cinemashould have aMoviemodel that has the following fields:title- a film titledescription- a film descriptionduration- a film duration in minutes
- Implement a serializer for this model.
- Create api views for the following endpoints:
GET api/cinema/movies/- should return a list of the all moviesGET api/cinema/movies/<pk>/- should return a movie with given idPOST api/cinema/movies/- should create a new movie based on passed dataPUT api/cinema/movies/<pk>/- should update the movie with given id based on passed dataDELETE api/cinema/movies/<pk>/- should delete the movie with given id
Use the following command to load prepared data from fixture to test and debug your code:
python manage.py loaddata cinema_service_db_data.json