guelo / councilmatic

Oakland City Council Legislative Information
11 stars 3 forks source link

Oakland Councilmatic!

City Council Legislative Subscription Service.

This is a fork of Councilmatic to port it for Oakland.

Getting Started

(If you want to use Vagrant to get things setup automatically, skip to the Getting Started with Vagrant section farther down this page)

First check out the project code.

$ git clone https://github.com/guelo/councilmatic.git

To work on your own instance of Councilmatic, you should first get Python installed. Follow the instructions for doing so on your platform.

In addition, we recommend setting up a virtual environment for working with any project, so that you can manage your project-specific dependencies.

$ cd councilmatic
$ virtualenv .env --no-site-packages
$ source .env/bin/activate

Next, install the requirements for Councilmatic (we recommend working in a virtual environment, but it's not strictly necessary).

$ pip install -r requirements.txt

Non-Python requirements include:

Legislation source

Copy the file councilmatic/local_settings.py.template to councilmatic/local_settings.py. Fill in the LEGISLATION setting in this file. By default, it is set up to scrape from Philadelphia's legislation system.

You should also set other local overrides. For example, for Oakland, set TEMPLATE_DIRS = ( rel_path('cities/oakland/templates'), rel_path('phillyleg'), rel_path('templates'), )

Database

Create a database for Councilmatic. Typically this is done like:

createdb -T template_postgis councilmatic

where template_postgis is the name of your PostGIS database template. If you do not yet have one, you can find instructions for getting your system ready for Django and PostGIS online. For example, here are instructions for Mac, and Ubuntu. For other platforms, and for further instructions, the GeoDjango docs are a good place to look.

NOTE that PostGIS 2.0 is not compatible with Django 1.4. As Councilmatic is currently not set up to run on Django 1.5, you should install PostGIS 1.5

Set up the project database and populate it with city council data (when the syncdb command prompts you to create an administrative user, go ahead and do so). There is a lot of data to be loaded, so downloading it all may take a while.

$ cd councilmatic
$ python manage.py syncdb # Create admin account when prompted.
$ python manage.py migrate
$ python manage.py updatelegfiles
$ python manage.py rebuild_index # For searches. Say yes when prompted.
$ python manage.py collectstatic # For jss and css. Say yes when prompted.

Development server

Finally, to run the server:

$ python manage.py runserver

Now, check that everything is working by browsing to http://localhost:8000/. Now browse to http://localhost:8000/admin and enter the admin username and password you supplied and you should have access to all of the legislative files!

Getting Started With Vagrant

  1. First check out the project code. $ git clone https://github.com/guelo/councilmatic.git

  2. Download and install Virtualbox from https://www.virtualbox.org/wiki/Downloads

  3. Download and install Vagrant from http://www.vagrantup.com/

  4. Open a terminal and navigate the the councilmatic directory and enter vagrant up. This will provision and setup Councilmatic in a virtual machine. (The virtual machine defaults to 1024 MB of RAM. This value can be changed in the Vagrantfile). This step may take a while.

  5. Run vagrant ssh to ssh into your new virtual machine.

  6. Run python /vagrant/councilmatic/manage.py runserver 0.0.0.0:8000 to start the development server.

  7. Visit http://localhost:8000/ in your browser to see Councilmatic in action!

Next Steps

The vagrant setup skips indexing the legislation files for searching as it takes a long time. Until you index the files, a search will return zero results. To index the legislation files, run python /vagrant/councilmatic/manage.py rebuild_index --noinput.

Copyright

Copyright (c) 2010 Code for America Laboratories See LICENSE for details.