Skip to content

Pogchamp-company/kinopoisk-on-django

Repository files navigation

Kinopoisk on Django

Description

Short

Aggregator of movies

Full

A clone of kinopoisk.
At the moment, the user can view information about movies and persons,
watch news

Getting Started

Prerequisites

  1. Python3
  2. PostgreSQL
  3. Minio

Install & Run project

  1. Clone repo
git clone https://github.com/Pogchamp-company/kinopoisk_on_django.git
  1. Create Python Virtual Environment
  2. Install requirements
pip install -r requirements.txt
  1. Create PostgreSQL database
  2. Set env variables
  3. Migrate database
# cd src
manage.py migrate
  1. Run minio
# cd ..
docker-compose up -d minio
  1. Initialize Minio buckets
manage.py initialize_buckets
  1. Collect static files
manage.py collectstatic
  1. Optional: run seeds
  2. Run project
manage.py runserver

Seed data

Base (Top 250 kinopoisk movies)

  1. Generate seeders json or download this in release
  2. Run
manage.py loaddata seed/movies.json
manage.py loaddata seed/persons.json
  1. Get posters
  2. Run
manage.py load_posters
manage.py load_photos

Add movie from kinopoisk

YOUR_API_KEY

Run

manage.py add_kp_movie {movie_id} --api-key {YOUR_API_KEY}

Generate movie score

Run

manage.py seed_users {users_count}
manage.py seed_scores

Run tests

!Warning: seed data before running tests

bash run_tests.sh

Built With

Contributing

Code style

pep8

Tasks

Branch naming

{username}/{task_short_description}

Authors

  • Roman Alexandrov - Documentation, Backend - Github
  • Artem Golovin - Backend - Github
  • Sergey Sirotkin - Main frontend developer - Github

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Environment variables

Variable Short description Default
SECRET_KEY App session secret key @oowa+)%q57uxhffto99*-b+mt%63!@r&#17mqstv&%fr92*
DATABASE_URI PostgreSQL connection URI postgresql+psycopg2://postgres@localhost:5432/KOD
MINIO_ENDPOINT Endpoint to connect minio 127.0.0.1:9001
MINIO_ACCESS_KEY Minio user minio
MINIO_SECRET_KEY Minio password minio123
MINIO_USE_HTTPS - False