Backend server for a social network for writers wishing to share their original content. REST API features include:
- Posts: Create, edit, update, and delete.
- Comments: Fetch, update, and delete.
- Groups: Participation and management.
- Followings: Follow users.
- Authorization: JWT authorization support.
- Clone the repository:
git clone git@github.com:nir0k/api_final_yatube.git cd api_final_yatube
- Create and activate a virtual environment:
python3 -m venv env source env/bin/activate
- Install dependencies:
python3 -m pip install --upgrade pip pip install -r requirements.txt
- Apply migrations:
cd yatube_api python3 manage.py migrate
- Start the project:
python3 manage.py runserver
-
Obtaining JWT Token:
POST http://127.0.0.1:8000/api/v1/jwt/create/
Payload:
{ "username": "string", "password": "string" }
-
Fetching posts: GET http://127.0.0.1:8000/api/v1/posts/
-
Filtering posts: GET http://127.0.0.1:8000/api/v1/posts/?limit=2&offset=4
limit
- number of posts to fetch.offset
- which post to start from.
-
Fetching a single post: GET http://127.0.0.1:8000/api/v1/posts/{ID}/
-
Creating a post: POST http://127.0.0.1:8000/api/v1/posts/
Anonymous requests are not allowed.
{ "text": "string", "image": "string", "group": 0 }
-
Fetching a list of groups: GET http://127.0.0.1:8000/api/v1/groups/
-
Fetching followings: GET http://127.0.0.1:8000/api/v1/follow/
Returns all followings of the user making the request. Anonymous requests are not allowed.
-
Searching for a following: GET http://127.0.0.1:8000/api/v1/follow/?search="{username}"
Full API Description : http://127.0.0.1:8000/redoc/