Giter Site home page Giter Site logo

starnavi_mkg3's Introduction

starnavi

A brief guideline to run it (on Windows):

1.Activate virtual environment

    .\venv\Scripts\activate

2.Install the required libs for the project

    pip install -r requirements.txt

3.Create super user

    python manage.py createsuperuser

and try to run it :D

    python manage.py runserver

Basic models:

● User(from django auth, but added 1 parameter)

● Post

Basic Features:

● user signup

 POST request to /api/users/ or /auth/users/ with data in body [username, password]

● user login

 POST request to /api/token/ with data in body [username, password] and you get a refresh and access tokens

● post creation

 POST request to /api/posts/ with data 

   [
    text -> text field 5000 max char
    published -> boolean
    is_reply -> boolean
    author -> id of user
    parent_post -> id of post or u can don't write this parameter if new post is not part of brench
   ]

● post like

 POST request to /api/likes/ with data 
  [
    user -> id of user
    post -> id of post 
  ]

● post unlike

 DELETE method to /api/likes/<like_id>

● analytics about how many likes was made. API should return analytics aggregated by day.

 GET request to /api/analytics/?date_from=<date_from>&date_to=<date_to>

● user activity an endpoint which will show when user was login last time and when he

mades a last request to the service.

 GET request to /api/users/<user_id>/activity/

additionaly i added:

 GET request to /api/posts/<post_id>/likes/ gives u all likes to current post with post_id

all requests except post request to create user need jwt token in header that looks like:

 Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjU1OTEyOTkzLCJqdGkiOiJiZGQ5ZWQ4ZTE0ZTE0YTllYmExMTAzMTMwYjljNjFkZiIsInVzZXJfaWQiOjF9.ChuD-xKTrE8mahv7HrpFxVahWVwZWIFnA0phekISuug

all possible endpoints are possible at

 /swagger/

Thank you for your attention :D

starnavi_mkg3's People

Contributors

ikayevaibar avatar trellixvulnteam 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.