This app allows you to manage your blog using HTTP requests. It is possible to view, create, edit, delete and block articles. It is also possible to register and authorize users.
All dependencies locate in pyproject.toml
, so you can use poetry
-
You need to download all files from this repository
git clone https://github.com/HolyDorus/blog_api
-
Use this command to install all dependencies
cd blog_api poetry install
-
You need to create file
.env
with filled values (see.env.example
) or manually add values in your enviroment variables -
Next, run application
poetry run python runserver.py
-
You can send requests to localhost:5000 (by default)
A table describing all the endpoints is shown below.
URL | Method | Description |
---|---|---|
/articles/ | GET | Returns a list of articles |
/articles/ | POST | Creates a new article |
/articles/{article_id}/ | GET | Returns article by id |
/articles/{article_id}/ | PUT, PATCH | Updates article by id |
/articles/{article_id}/ | DELETE | Removes article by id |
/articles/{article_id}/ban/ | POST | Ban (hide) article by id |
/articles/{article_id}/unban/ | POST | Unban (unhide) article by id |
/auth/login/ | POST | Authorizes the user and returns access and refresh tokens |
/auth/register/ | POST | Registers a new user |