Skip to content

Instantly share code, notes, and snippets.

@jackiekazil
Last active August 29, 2015 14:05
Show Gist options
  • Save jackiekazil/08d16dc7104947f60ff4 to your computer and use it in GitHub Desktop.
Save jackiekazil/08d16dc7104947f60ff4 to your computer and use it in GitHub Desktop.

Revisions

  1. jackiekazil revised this gist Aug 13, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion foia-core-setup
    Original file line number Diff line number Diff line change
    @@ -43,7 +43,9 @@ django-admin.py syncdb
    cd foia-core/foia_core/scripts

    # Load some contacts
    python load_agency_contacts.py
    python load_agency_contacts.py $LOCATION_OF_YAMLS
    # example:
    python load_agency_contacts.py ~/Projects/code/foia/foia/contacts/data


    # launch server locally
  2. jackiekazil created this gist Aug 11, 2014.
    57 changes: 57 additions & 0 deletions foia-core-setup
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    --------------------------
    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


    # 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