Git Product home page Git Product logo

kiril's Introduction

Kiril - Stat service

GitHub

  • Create service by api/create data must be positive in format (if obj found by date , will be agregated)
{
    "views":1,
    "clicks":2, 
    "cost":45.36,
    "date": "2021-01-15"
}

views, clicks is positive integer cost is decimal number (in us dollars), .0-99 max cents available

return : {"msg": "entry created"}, status=200. or appropriate error message {"msg": "some error"}

  • Showing statistics by date api/show_by_date date must be in format 'yyyy-mm-dd'
{
    "start_date":"2021-1-10",
    "end_date":"2021-1-23",
    "order":"clicks"
}

have additional feature is ordering by one of the values (views,clicks,cost,date)

  • user can delete all data from table by api/remove_all
{
    "answer":"yes"
}

if answer yes data will be deleted

i am showed how to connect in settings.py to postgres todo is :

  1. install psycopg2
  2. crete settings separator folder with 2 settings (one for local one for product)
  3. in new settings/__init__.py check the system working place for adjust appropriate settings file data example

kiril's People

Contributors

anton6896 avatar dependabot[bot] avatar

Watchers

 avatar

kiril's Issues

wrong query

query ::

SELECT "statistic"."id", "statistic"."views", "statistic"."clicks", "statistic"."cost", "statistic"."date" FROM "statistic" WHERE ("statistic"."date" >= 2021-06-08 00:00:00 AND "statistic"."date" <= 2021-06-09 00:00:00) ORDER BY "statistic"."clicks" ASC

with this Django still wont return "statistic"."date" <= 2021-06-09

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.