Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
foia-core setup
--------------------------
Project setup
--------------------------
clone repo
brew install python3
mkvirtualenv --python=/usr/local/bin/python3 foia-core
cd ~/Project/code/foia/foia-core
add2virtualenv .
--------------------------
Database set up
--------------------------
brew install postgres
createdb foia
if:
createdb: could not connect to database template1: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
then:
export PGHOST=localhost
psql -d foia -c "CREATE USER foia WITH PASSWORD 'foia';"
export DJANGO_SETTINGS_MODULE=foia_core.settings.dev
--------------------------
Getting Started
--------------------------
pip install -r requirements.txt
# assuming that you have django setting module set & db set up
django-admin.py syncdb
cd foia-core/foia_core/scripts
# Load some contacts
python load_agency_contacts.py $LOCATION_OF_YAMLS
# example:
python load_agency_contacts.py ~/Projects/code/foia/foia/contacts/data
# launch server locally
django-admin.py runserver
# if you want a specific port
# django-admin.py runserver 0.0.0.0:8080
# in browser
http://localhost:8000/data/agency/
http://localhost:8000/data/agency/institute-of-museum-and-library-services
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment