This Repository is a REST API built with Django, aimed at providing anime recommendations based on user preferences. The API utilizes Django to manage user authentication, store anime data, and generate recommendations dynamically.
POST /api/auth/register/
: Register a new user.POST /api/auth/login/
: Login and obtain an authentication token.POST /api/auth/logout/
: Logout and invalidate the authentication token.
GET /api/anime/
: List all anime entries.POST /api/anime/
: Add a new anime entry.GET /api/anime/<id>/
: Retrieve details of a specific anime.PUT /api/anime/<id>/
: Update details of a specific anime.DELETE /api/anime/<id>/
: Delete a specific anime entry.
GET /api/recommendations/
: Get personalized anime recommendations for the authenticated user.
- Clone the repository:
git clone https://github.com/Dev-Aligator/animercs-backend.git
2. Create Virtual Environment:
Creating Virtual Environment named env
python -m venv env
To Activate env
(on Linux bash/zsh), checkout the venv docs for other flatforms
source env/bin/activate
To deactivate env
deactivate
- Install dependencies:
pip install -r requirements.txt
4. Setup Database:
Making database migrations
python manage.py makemigrations
python manage.py migrate
To import Anime data to the database, Download this CSV file containing anime data crawled from MyAnimeList, having information for over 16,000 anime entries across various genres.
Modify the scripts.py
file to specify the location of your downloaded animes.csv
file.
Then, Run the following command to execute the script and import the anime data into the database:
python manage.py shell < scripts.py
Note: If you're utilizing your own data source, ensure its format aligns with the expected model fields in the Django model (Anime) for successful insertion.
- Creating superuser to access Admin Panel:
python manage.py createsuperuser
- Run the Server:
python manage.py runserver
Crawling Information: For details regarding the process of crawling anime data from MyAnimeList or similar sources, please refer to the following repository.
Dev-Aligator