Coder Social home page Coder Social logo

podcast-backend's Introduction

Podcasts API

Virtual Environment

Make sure you have virtualenv installed.
On creating a virtualenv called venv, run the following:

pip install git+https://github.com/cuappdev/appdev.py.git#egg=appdev.py
pip install -r requirements.txt

Setting up Database

Ensure you have mysql plus command line tools setup. Then run the following. It creates databases, migrates them, and loads in necessary dev / test data:

./setup.sh

If the migrations directory is ever deleted, you can regenerate it with the following:

python manage.py db init --multidb

Environment Variables

I highly recommend autoenv. The required environment variables for this API are the following:

DB_USERNAME
DB_PASSWORD
DB_HOST
DB_NAME
PODCAST_DB_USERNAME
PODCAST_DB_PASSWORD
PODCAST_DB_HOST
PODCAST_DB_NAME
TEST_DB_USERNAME
TEST_DB_PASSWORD
TEST_DB_HOST
TEST_DB_NAME
TEST_PODCAST_DB_USERNAME
TEST_PODCAST_DB_PASSWORD
TEST_PODCAST_DB_HOST
TEST_PODCAST_DB_NAME
APP_SETTINGS # e.g. config.DevelopmentConfig
FACEBOOK_APP_ID
FACEBOOK_APP_SECRET
PODCAST_ML_API_KEY
PODCAST_ML_URL

FACEBOOK_APP_ID and FACEBOOK_APP_SECRET can be obtained by logging in to facebook developers page and creating an app or from the project lead. If using autoenv for local development, create a .env file, like the sample below:

export DB_USERNAME=CHANGEME
export DB_PASSWORD=CHANGEME
export DB_HOST=localhost
export DB_NAME=pcasts_db_dev
export PODCAST_DB_USERNAME=CHANGEME
export PODCAST_DB_PASSWORD=CHANGEME
export PODCAST_DB_HOST=localhost
export PODCAST_DB_NAME=pcasts_podcast_db_dev
export TEST_DB_USERNAME=CHANGEME
export TEST_DB_PASSWORD=CHANGEME
export TEST_DB_HOST=localhost
export TEST_DB_NAME=test_pcasts_db_dev
export TEST_PODCAST_DB_USERNAME=CHANGEME
export TEST_PODCAST_DB_PASSWORD=CHANGEME
export TEST_PODCAST_DB_HOST=localhost
export TEST_PODCAST_DB_NAME=test_pcasts_podcast_db_dev
export APP_SETTINGS=config.DevelopmentConfig
export FACEBOOK_APP_ID=CHANGEME
export FACEBOOK_APP_SECRET=CHANGEME
export PODCAST_ML_API_KEY=CHANGEME
export PODCAST_ML_URL=CHANGEME

In the /tests directory, create another .env file that changes the APP_SETTINGS:

export APP_SETTINGS=config.TestingConfig

Testing

To run all unit tests, from the /tests directory, run:

./test.sh

To run a single test, from the /tests directory, run:

./test.sh test_file_name.py

podcast-backend's People

Contributors

amit-mizrahi avatar chenjesse avatar danielnosrati avatar ifilonenko avatar jma353 avatar kevingreer avatar say25 avatar

Watchers

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