Python / Flask / SQLAlchemy
SF movies locations API implementation
Build with Python and Flask
- python3.4.1
- virtualenv install virtualenv
In your favorite terminal:
Create a new virtual environment:
$ virtualenv -p `which python3` venv
Activate it (You must source the virtualenv environment for each terminal session where you wish to run your app):
. venv/bin/activate
Install the requirements:
$ pip install -r requirements.txt
Import data from the cvs file in the database:
$ python manage.py import_db
Run the tests (Optional):
$ python manage.py test
Run the dev server:
$ python manage.py runserver
To run the application with gunicorn:
Install production requirements:
$ pip install -r requirements/prod.txt
set the environment variables or write it in an '.env' file in the top folder:
FLASK_CONFIG=production
DATABASE_URL={protocol}[+{driver}]://{user}:{password}@{host}/{database}"
Run the gunicorn server:
$ gunicorn manage:app
Install Toolbelt
Heroku Login
Upload ssh public key
Create app
Provisioning database
Promote database
add a Procfile
Push project on heroku
$ git push heroku master
Add a dyno
Get all locations
Get all movie titles
Get information about a movie
Get all locations for a movie
Get all director names
Get information about a director
Get all director movies
Get all director's movie locations
Get all writer names
Get information about a writer
Get all writer's movies
Get all writer's movie locations
Get all actors names
Get information about an actor
Get all actor's movies
Get all actor's movie locations