Skip to content

slsh1o/rest-api-socialnetwork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST API test task

Installing

To install simply clone this repo and run pip install -r requirements.txt. Then apply the migrations.

Presentation

Start server and run python bot.py script for short showcase of the api routes.

API

  • POST api/jwtauth/register/ - register new user. Params: username, email, password, password_repeat.
  • POST api/jwtauth/login/ - obtain access and refresh tokens. Params: username, password.
  • POST api/jwtauth/refresh/ - get refreshed access token. Params: refresh token.
  • POST api/posts/ - create new post. Params: title, content.
  • GET api/posts/ - list all posts.
  • GET api/posts/<int:post_id>/like/ - like or unlike post.
  • GET api/analytics/user/<int:pk>/ - show time of user's last login and request to the api.
  • GET api/analytics/likes/ - show amount of likes aggregated by day. Optionaly ?date_from=&date_to= can be passed via url to specify range of days.

About

Simple REST API with Django & DRF

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages