akurihara / whichflix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CircleCI Codecov

whichflix

Whichflix makes the toughest part of movie night quick and efficient - choosing a movie. Suggest a movie, or vote on the suggestions of others. The movie with the most votes wins!

Documentation

This project uses Redoc to serve OpenAPI 2.0 documentation defined in each views.py file. See the documentation here.

Set Up (Locally)

  1. Create a virtual environment and install dependencies.

    $ brew install pyenv
    $ brew install pyenv-virtualenv
    $ pyenv install 3.7.4
    $ pyenv virtualenv 3.7.4 whichflix
    $ pyenv activate whichflix
    $ (whichflix) pip install -r requirements.txt
    
  2. Set up environmental variables.

    cp .env.sample .env
    

    Update the following variables in the .env file:

    • TMDB_API_KEY - Your API key for The Movie Database, which can be obtained by following these instructions.
    • DATABASE_URL - Database URL specifying which SQL database to connect to locally (e.g. postgres://:@localhost:5432/whichflix).
  3. Install Postgres, create a new database, and initialize tables.

    $ brew install postgresql
    $ brew services start postgresql
    $ createdb whichflix
    $ source .env && python whichflix/manage.py migrate
    

Running the Server

$ (whichflix) source .env && python whichflix/manage.py runserver

Runnings Tests

$ (whichflix) source .env && python whichflix/manage.py test test/.

Developing with Docker

  1. Install Docker and Docker Compose.

  2. Run the server using docker-compose.

    $ docker-compose --env-file /dev/null up
    
  3. Run the tests using docker-compose.

    $ docker-compose --env-file /dev/null run whichflix python whichflix/manage.py test
    

About


Languages

Language:Python 99.2%Language:HTML 0.5%Language:Dockerfile 0.3%