A simple Django backend for the Movie Recommender project. It uses Django as a backend and for rest-api implementation it uses django-rest-framework.
Total 400,000 Movies Data were collected using the TMDB API. Only 10,000 movies were filtered out to reduce the size of the database.
For user authentication Djoser is used, which is a simple authentication library for Django.
- Create a virtual environment for the django project first. For example, I created a virtual environment for the project using virtualenv.
- Install the dependencies using the following command:
pip install -r requirements.txt
- Create a database using the following command:
python manage.py makemigrations && python manage.py migrate
- Import the movies data and movie details in respective tables.
- Create a .env file in the
finalYearProject
directory of the project and add the following lines:- secret_key=
- DATABASE_NAME=
- LOCAL_DB_PASSWORD=
- DEBUG=True
- EMAIL_HOST=
- EMAIL_HOST_PASSWORD=
- Run the server using the following command:
python manage.py runserver
- Go to the
http://localhost:8000/docs/
to see the api endpoints.
The defualt database used by the current code is sqlite and the database name is movie_recommendation_db
.
You can choose mysql as your database if you want to use the mysql database.