Last active
August 29, 2015 14:05
-
-
Save jackiekazil/08d16dc7104947f60ff4 to your computer and use it in GitHub Desktop.
foia-core setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------- | |
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