This project demonstrates the basic capabilities of Django framework and Django REST Framework for creating a movie database website.
Web application with minimal frontend where users can view and edit a list of movies, actors and directors.
Each movie have the following details:
- Title
- Release Date
- List of Directors
- List of Actors
Database population is done through the API from https://www.omdbapi.com/
CRUD operations for Movie, Actor, Director.
https://movie-database-y78h.onrender.com
/api/movies/
(GET, POST)/api/movies/<id>/
(GET, PUT, DELETE)/api/directors/
(GET, POST)/api/directors/<id>/
(GET, PUT, DELETE)/api/actors/
(GET, POST)/api/actors/<id>/
(GET, PUT, DELETE)
- CRUD operations for movies
- CRUD operations for actors
- CRUD operations for directors
- Pagination for list views
- Filters for movies, actors, directors (via django_filters) for both frontend and API
- API endpoints for CRUD operations with movies, actors, directors
- Django Framework
- Django REST Framework
- Django Filters
- SQLite (for development)
- PostgreSQL (for production)
-
Clone the repository:
git clone https://github.com/your-username/movie-database.git cd movie-database
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Acquire API key for OMBD API:
https://www.omdbapi.com/apikey.aspx
And then put it into .env file (see .env-sample for reference) -
Load data form OMDB API using management command:
python manage.py migrate import_movies 80000 81000
Note: 80000 and 81000 are range of movies' IMDB IDs, explanation from IMDB below:
tt0050083 is the unique identifier for the movie "12 Angry Men (1957)", where tt signifies that it's a title entity and 0050083 uniquely indicates "12 Angry Men (1957)"
-
Run the development server:
python manage.py runserver
-
Access the website at http://localhost:8000/