Movies4U is a Django-based web application that provides a platform for users to browse, search, and add movies to their watchlist. The application uses a combination of Python, Django, HTML, CSS, and JavaScript to provide a seamless user experience.
The project is structured as follows:
capstone/
: The main Django project directory.final/
: The Django application directory.films.ipynb
: Jupyter notebook used for scraping movie data.manage.py
: Django's command-line utility for administrative tasks.requirements.txt
: Contains the Python dependencies required for the project.
-
models.py
: Contains theUser
andFilm
models.User
: Inherits from Django'sAbstractUser
and includes awatchlist
field with a many-to-many relationship with theFilm
model.Film
: Represents the information of the films.
-
views.py
: Contains all the backend logic of the project.- Defines views for displaying the index page, handling film retrieval, search functionality, watchlist management, and user authentication.
-
urls.py
: Contains all the paths of the app.- Paths include film retrieval, search, login, logout, registration, and watchlist management.
-
templates/final/index.html
: The main application page.- Extends the layout and includes sections for the navbar, film information, film display, watchlist display, and search.
-
templates/final/layout.html
: Contains the layout of the app.- Includes links to the JavaScript and CSS files of the app.
-
static/final/index.js
: Contains JavaScript functions for managing the interface of the app.- Functions include adding films to the watchlist and displaying film information.
-
films.ipynb
: Contains the logic for scraping movie data from the web.- Defines a function for requesting and parsing film data, and writes the data to a JSON file.
-
util.py
: Loads the embeddings for each word in the dictionary.- Contains
get_recommendations()
which uses the embeddings of each movie's description and recommends similar movies using K-Nearest Neighbours Algorithm.
- Contains
To set up the project, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/movies4u.git cd movies4u
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required Python dependencies:
pip install -r requirements.txt
-
Run the Django migrations:
python manage.py migrate
-
Start the Django development server:
python manage.py runserver
- Register: Create a new user account by navigating to the registration page and filling in the required details.
- Login: Access your account using your username and password.
- Browse Films: View a list of films on the main page after logging in.
- Search Films: Use the search functionality to find specific films by entering keywords.
- Add to Watchlist: Add films to your watchlist by clicking the appropriate button next to each film.
- View Watchlist: Access your watchlist to see the films you've added.
- Remove from Watchlist: Remove films from your watchlist by clicking the appropriate button next to each film.
- Add to Watched List: Mark films as watched by clicking the appropriate button next to each film.
- View Watched List: Access your watched list to see the films you've marked as watched.
- Remove from Watched List: Remove films from your watched list by clicking the appropriate button next to each film.
- View Recommendations: Get personalized film recommendations based on your watched list.
Contributions are welcome. Please submit a pull request with your proposed changes.