The goal of this project is to get the imago project, scraper-us-municipal project, and councilmatic-starter-template all working together.
- Install docker an docker-compose if you do not have them installed
- Clone this scrapers project into the the folder
scrapers
in this project: https://github.com/feydan/scrapers-us-municipal. - Clone this sacramento-councilmatic project into the folder
sacramento-councilmatic
into this project: https://github.com/code4sac/sacramento-councilmatic and switch to thecouncilmatic-stack
branch - Clone this api project intot he folder
api
in this this project: https://github.com/datamade/api.opencivicdata.org
- In the
sacramento-councilmatic/councilmatic
folder, copysettings_deployment.py.example
tosettings_deployment.py
, and when developing locally change theDEBUG = False
line toDEBUG = True
- Run
docker-compose up
to start the database and scrapers containers. Keep this terminal window running. - Run the initial migration for scrapers
docker-compose exec scrapers pupa dbinit us
- Run the initial migration for councilmatic
docker-compose exec councilmatic python manage.py migrate
- Run the initial cache table creation
docker-compose exec councilmatic python manage.py createcachetable
- Run the initial migration for api
docker-compose exec api python manage.py migrate
- Ensure the containers are running. If they are still running from the Initializing step above continue to step 2. Otherwise start the containers:
docker-compose up
. docker-compose exec scrapers /bin/bash
(ssh's into the scrapers project)pupa update sacramento
(runs the update script)exit
exit scrapers
- Ensure the containers are running. If they are still running from the Initializing step above continue to step 2. Otherwise start the containers:
docker-compose up
docker-compose exec scrapers /bin/bash
(ssh's into the councilmatic project)python manage.py import_data
exit
exit the scrapers
The web application is accessible at http://localhost:8001/ in your browser.
docker-compose exec postgresql psql opencivicdata pupa
- Fix bootstrapping so that you do not need to run the init scripts and have the update script automatically run on a cron job
Docker stuff: https://docs.docker.com/compose/django/#create-a-django-project
Open civic data api:
Scrapers US Municipal: opencivicdata/scrapers-us-municipal#243
Councilmatic: https://github.com/datamade/councilmatic-starter-template,