Skip to content

Fedodor/api_reviews

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Reviews

Python Django DRF JWT pytest Postman

A REST API for collecting reviews and comments on books, films, songs and other creative works.

The project was built as a team project. My main focus was backend API development with Django REST Framework, permissions, authentication flows and keeping the API structure clear enough for other developers to use.

What the API does

  • Stores titles grouped by categories and genres
  • Lets authenticated users create reviews and comments
  • Allows users to edit or delete their own content
  • Supports moderator permissions for review/comment moderation
  • Supports admin permissions for managing users, categories, genres and titles
  • Uses JWT authentication
  • Includes tests and a Postman collection

Roles

Role Permissions
Anonymous user Read public content
User Create reviews, comment on reviews, edit/delete own content
Moderator Moderate reviews and comments
Admin Manage users, titles, categories and genres

Tech stack

  • Python
  • Django
  • Django REST Framework
  • JWT authentication
  • pytest
  • SQLite for local development
  • Postman collection for API testing

Local setup

git clone git@github.com:Fedodor/api_reviews.git
cd api_reviews

Create and activate a virtual environment:

python3.9 -m venv venv
source venv/bin/activate

Install dependencies:

python -m pip install --upgrade pip
pip install -r requirements.txt

Apply migrations:

cd api_yamdb
python manage.py migrate

Run the project:

python manage.py runserver

Import sample data

From the directory with manage.py:

python manage.py csv_to_db

Example endpoint

Create a review for a title:

POST /api/v1/titles/{title_id}/reviews/
{
  "text": "A short review text",
  "score": 8
}

About

Team-built DRF API for reviews and comments with JWT authentication, role-based permissions, moderation and tests.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages