You will need the following installed on your OS of choice to run Achoo:
- Python 3
- R
- PostgreSQL
- PostGIS with command line tools
We recommend using a virtualenv to manage Python dependencies.
To install the Python dependencies, run the following from the project root:
pip install -r requirements.txt
Variable Name | Value |
---|---|
ACHOO_SECRET_KEY |
Key for signing things, set to strong random value. |
ACHOO_PG_CONN_STR |
SQLAlchemy database URI (PostgreSQL). Something like postgresql://user@localhost:5432/achoo . |
ACHOO_GOOGLE_MAPS_API_KEY |
Google Maps API Key. |
From the application root directory, run the following in a python interpreter to create the database and tables:
from app.models.models import db
db.create_all()
Initialize PostGIS:
psql achoo
CREATE EXTENSION postgis;
\q
Download and import GIS shapefiles and clean up:
mkdir gisdata
cd gisdata
wget http://www2.census.gov/geo/tiger/GENZ2016/shp/cb_2016_us_zcta510_500k.zip
unzip cb_2016_us_zcta510_500k.zip
shp2pgsql cb_2016_us_zcta510_500k.shp > gisdata.sql
psql achoo < gisdata.sql
cd ..
rm -r gisdata
python3 application.py
Or:
export FLASK_PATH=/path/to/Achoo/application.py
flask run --reload
TODO