GithubHelp home page GithubHelp logo

epidemic's Introduction

Epidemic Test

A Movie collection Database

Requirements

1. Fetch test data via https from OMDB API

  • You should fetch 100 movies from OMDB API. It's up to you what kind of movies you will get.
  • Movies should be saved in the database.
  • This method should be ran only once if database is empty.

2. Implement an api

  • The api should have a method that returns a list of movies from the database
  • There should be option to set how many records are returned in single API response (by default 10)
  • There should be pagination implemented in the backend
  • Data should be ordered by Title
  • The api should have a method that returns a single movie from the database
  • There should be option to get the movie by title
  • The api should have a method to add a movie to the database
  • Title should be provided in request
  • All movie details should be fetched from OMDB API and saved in the database
  • The api should have a method to remove a movie from the database
  • There should be option to remove movie with it's id
  • This method should be protected so only authorized user can perform this action (There is test user in the database)

3. Unit tests for all cases

Solution

Run locally

clone the Project

git clone [email protected]:dannkkie/epidemic.git

cd into project root dir

cd epidemic

Build Image

docker-compose build

Run containers

docker-compose up -d

Create migrations

docker-compose exec movies python manage.py makemigrations

Appy migrations

docker-compose exec movies python manage.py migrate

Seed database

docker-compose exec movies python manage.py seed_db

Create a test user

docker-compose exec movies python manage.py createsuperuser

Run tests

docker-compose exec movies pytest -p no:warnings

Lint

docker-compose exec movies flake8 .

Run black and isort with check options

docker-compose exec movies black --exclude=migrations --check .
docker-compose exec movies isort . --check-only

Make code changes with Black and isort

docker-compose exec movies black --exclude=migrations .
docker-compose exec movies isort .

Usage

Run below command to create a super user

epidemic's People

Contributors

dannkkie avatar

Watchers

 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.