Code Monkey home page Code Monkey logo

api_final_yatube's Introduction

API for Yatube

The project implements an API for all Yatube project models.

Tech Stack

Python 3.9
Django 3.2
Djangorestframework 3.12

Run Locally

Clone the project

  git clone https://github.com/Nurbek878/api_final_yatube

Go to the project directory

  cd api_final_yatube

Install and activate the virtual environment

  python3 -m venv venv
  source venv/bin/activate

Install dependencies from the file requirements.txt

  pip install -r requirements.txt

Make migrations

  python manage.py migrate

Start the server

  python manage.py runserver

API Reference

Pass the username and password and get the token

  POST  api/v1/jwt/create/

Execute all requests with parameters

Key Value
Authorization Bearer <your token>

Get a list of all posts or create a new post

  GET,POST                   api/v1/posts/

Receive, edit or delete a post by id

  GET, PUT, PATCH, DELETE    api/v1/posts/{post_id}/

Get a list of all groups

  GET                        api/v1/groups/

Get information about a group by id

  GET                        api/v1/groups/{group_id}/

Get a list of all post comments with id=post_id or create a new one by specifying the id of the post we want to comment on

  GET,POST                    api/v1/posts/{post_id}/comments/

Receive, edit or delete a comment by the id of a post with id=post_id

  GET, PUT, PATCH, DELETE     api/v1/posts/{post_id}/comments/{comment_id}/

Running Tests

To run tests, run the following command

  pytest

Authors

api_final_yatube's People

Contributors

nurbek878 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.