staterepme/State-Gov-Tracker — pull request #13 by ahinz (2013-03-12 03:19:45+00:00)
Title: General automation and de-pennsylvaniation of the site

I realize that this is a sort of huge update - I would be happy to package up smaller parts if it would be better for you guys. It generally doesn't touch very much application code so hopefully it isn't too much of an imposition.

The big highlight is the vagrant and ansible integration. To get an instance of staterep.me running with nginx and gunicorn simply do:

```bash
> pip install git+git://github.com/ansible/ansible.git
> cp playbooks/ansible_vars.example.yml playbooks/ansible_vars.yml
> $EDITOR playbooks/ansible_vars.yml
> scripts/vagrant-ansible.sh
```
Then head on over the [http://localhost:6060] and enjoy!

Using the data loading scripts gets even closer:
```bash
$ vagrant ssh
> cd /usr/local/staterep/app
> source ../env/bin/active
> export STATE=WI
> python manage.py load_leg_data $STATE
> python manage.py update_bills $STATE
> exit
```

One last note. Postgres can act about a bit about sloppy SQL types (i.e. postgres doesn't support directly comparing ints and strings). To get around this you can run:

```sql
CREATE CAST (integer AS text) WITH INOUT AS IMPLICIT
```

As a superuser on the postgres database.