Skip to content

Alexandr-Safariantc/reviews_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Team Review

reviews_api

App to share your valuable reviews
--> Quick start <--

Table of Contents
  1. Features
  2. Getting Started
  3. Explanations
  4. Restrictions
  5. Project team

Features

  • Adding your valuable reviews to each work (book, film, song, etc.).
  • Selecting a work to review from one of the categories or genres.
  • Adding a score from 1 to 10 to each work and getting the average score for all reviews.
  • Adding your comments to reviews of other users.

Built With

Getting Started

Run as python script

Prerequisites

  • python 3.9.19
  • pip

Installation

  1. Clone the repo
    $ git clone https://github.com/Alexandr-Safariantc/reviews_api
  2. Activate virtual environment
    $ cd reviews_api
    $ python3 -m venv venv
  • for Linux/macOS
    $ source .venv/bin/activate
  • for windows
    $ source .venv/scripts/activate
  1. Upgrage pip

    (venv) $ python3 -m pip install --upgrade pip
  2. Install requirements

    (venv) $ pip install -r requirements.txt
  3. Migrate database

    (venv) $ cd api_yamdb/
    (venv) $ python3 manage.py migrate
  4. Add test data to database

    (venv) $ python3 manage.py import_csv
  5. Run app

    (venv) $ python3 manage.py runserver
  6. Get API docs

    http://127.0.0.1:8000/redoc/

Secrets

.env secrets

ALLOWED_HOSTS: {IP address of server you want to deploy},127.0.0.1,localhost,{your domane name if exists}
DEBUG_VALUE: if not setted debug mode is off, not required
SECRET_DJANGO_KEY: secret key for Django app

(back to top)

Explanation

Database Structure

Category
Contains name, slug.

Genre
Contains name, slug.

Title
Contains category, description, genre, name, year.

GenreTitle
Linked model for Genre - Title relation.

Review
Contains author, pub_date, score, text, title.

Comment
Contains author, pub_date, review, text.

Restrictions

1. Year of title creation
We can't predict the future so only existing titles can be published in our feed.

2. One author - one review
We value the opinions of all reviews' authors equally so you can add only one review to each title.

3. Review score
Your review score must be integer number from 1 to 10.

4. Username 'me'
The username 'me' isn't the best choice, is it? This value is limited for our application.

(back to top)

Project team

Aleksandr Safariants - Backend-developer

Gmail Badge

Models, views, endpoints for:

  • titles,
  • users.

Users management:

  • registration, authentification system,
  • permissions,
  • token management,
  • e-mail confirmation system.

Iakov Kuznetsov - Backend-developer

Gmail Badge

Models for:

  • categories,
  • genres.

Views endpoints for:

  • categories,
  • genres,
  • reviews,
  • comments.

Additional tasks:

  • title scores,
  • import from .csv files.

Konstantin Leontiev - Teamlead

Gmail Badge

Models for:

  • reviews,
  • comments.

Additional tasks:

  • project management,
  • code review,
  • import from .csv files.

(back to top)

Releases

No releases published

Packages

 
 
 

Languages