Name: lighten-api
Owner: SFBrigade
Description: Lighten is a web-based tool for social service providers to store, update, and exchange social services information through a universal standard. We are solving the problem of quickly getting the right help to the right people, by making it easy to get the right information to the right people.
Created: 2016-02-18 16:03:16.0
Updated: 2017-03-18 19:52:30.0
Pushed: 2016-12-12 00:27:22.0
Homepage: https://github.com/sfbrigade/lighten/wiki
Size: 482
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This repo contains the Lighten API which runs on Heroku at https://lighten-api.herokuapp.com/.
The steps here only need to be run once.
Install Docker for Mac from https://docs.docker.com/docker-for-mac/
Install the Heroku CLI
brew install heroku
Clone the lighten-api
repo and submodules
git clone git@github.com:sfbrigade/lighten-api.git
cd lighten-api
git submodule update --init --recursive
Create an .env
file for holding environment variables
echo "SECRET_KEY=$(openssl rand -hex 24)" > .env
Bring up the development services
docker-compose up -d
Initialize the database
docker-compose exec api python manage.py migrate
Load initial data via fixtures
docker-compose exec api python manage.py loaddata lighten_api/organization
Create a superuser
docker-compose exec api python manage.py createsuperuser
Stop the development services
docker-compose stop
Bring up the development services
docker-compose up --build
The --build
option ensures any new dependencies are included.
Open the development API
open http://localhost:8080
Run tests as needed
docker-compose exec api python manage.py test
If you make any changes to the data models, you'll need to commit migrations
docker-compose exec api python manage.py makemigrations
git add */migrations
git commit
Deploy to Heroku
git push heroku master
Open the production API
heroku open
If you made any changes to the data models, you'll need to apply migrations
heroku run python manage.py migrate
docker-compose exec api bin/import-dataset development
docker-compose exec api bin/import-dataset production
For more information about using Python and Docker on Heroku, see these Dev Center articles: