GithubHelp home page GithubHelp logo

movie_db's Introduction

Movie DB

Setup

  1. (optional) create a virtualenv using e.g.

    virtualenv venv --python=python3

  2. Install dependencies

    pip install -r requirements.txt

  3. Run migrations

    ./manage.py migrate

  4. Run the application

    ./manage.py runserver

Endpoints

  • /movies

    • GET - returns a list of all movies

    • POST - accepts a JSON object with "title" field - a string to search for in the database. Example request:

      {
        "title": "avatar"
      }

      A movie found using given string gets written to database and returned.

  • /comments

    • GET - returns a list of all comments in the database. Example response:

      [
        {
          id: 2,
          movie_id: 1,
          text: "Movie good"
        },
        {
          id: 3,
          movie_id: 2,
          text: "Movie bad"
        }
      ];

      Also allows filtering by passing the movie_id query parameter.

    • POST - allows adding a comment to the movie. Example request:

      {
          "text": "Movie not so good",
          "movie_id": 3
      }
  • /top

    • GET - returns a ranking of most commented movies - requires 2 query parameters - start_date and end_date, therefore valid url would be something like /top?start_date=2018-01-01&end_date=2020-01-01. If parameters are not given returns a 400 Bad Request error.

Limitations

  • At the moment the application uses OMDB - an open movie database which allows only 1000 requests per day.

  • Pagination is not implemented, app may become slow if a lot of movies get written.

  • App expects OMDB API to be up and running and fails miserably if it's offline.

movie_db's People

Contributors

arturlange avatar dependabot[bot] avatar

Watchers

James Cloos 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.