Skip to content
👀 keep tabs on Chicago city council
Branch: master
Clone or download
Latest commit 51ea939 Jun 5, 2019

Chicago Councilmatic

Keep track of what Chicago City Council is doing.


Install OS level dependencies:

  • Python 3.4
  • PostgreSQL 9.4 +

Install app requirements

We recommend using virtualenv and virtualenvwrapper for working in a virtualized development environment. Read how to set up virtualenv.

Once you have virtualenvwrapper set up,

mkvirtualenv chi-councilmatic
git clone
cd chi-councilmatic
pip install -r requirements.txt

Afterwards, whenever you want to use this virtual environment to work on chi-councilmatic, run workon chi-councilmatic

OPTIONAL: install django-councilmatic locally
If you plan on making changes to core councilmatic features (as opposed to Chicago-specific stuff), you'll want to install django-councilmatic locally instead of installing from pypi.

cd ..
git clone
cd django-councilmatic
python develop
cd ../chi-councilmatic

Create your settings file

cp councilmatic/ councilmatic/

Then edit councilmatic/

  • DATABASES['default']['USER'] should be your username
  • if you're setting up councilmatic for local development, use a dummy cache by setting CACHES['default']['BACKEND'] to 'django.core.cache.backends.dummy.DummyCache'. if you're deploying, leave it as is

Setup your database

Before we can run the website, we need to create a database.

createdb chi_councilmatic

Then, run migrations

python migrate

Create an admin user - set a username & password when prompted

python createsuperuser

Importing data from the open civic data api

Run the loaddata management command. This will take a while, depending on volume (Chicago has ~70k bills, & it takes ~1 hour to load the data).

python import_data

By default, the import_data command is smart about what it looks at on the OCD API. If you already have bills loaded, it won't look at everything on the API - it'll look at the most recently updated bill in your database, see when that bill was last updated on the OCD API, & then look through everything on the API that was updated after that point. If you'd like to load things that are older than what you currently have loaded, you can run the import_data management command with a --delete option, which removes everything from your database before loading.

The import_data command has some more nuance than the description above, for the different types of data it loads. If you have any questions, open up an issue and pester us to write better documentation.

Setup CSS, Images, and other static resources

python collectstatic

Running Chicago Councilmatic locally

python runserver

navigate to http://localhost:8000/

Setup Search

Install Open JDK or update Java

On Ubuntu:

$ sudo apt-get update
$ sudo apt-get install openjdk-7-jre-headless

On OS X:

  1. Download latest Java from

  2. Follow normal install procedure

  3. Change system Java to use the version you just installed:

    sudo mv /usr/bin/java /usr/bin/java16
    sudo ln -s /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java /usr/bin/java

Download & setup Solr

tar -xvf solr-4.10.4.tgz
sudo cp -R solr-4.10.4/example /opt/solr

# Copy schema.xml for this app to solr directory
sudo cp solr_scripts/schema.xml /opt/solr/example/solr/collection1/conf/schema.xml

Run Solr

# Next, start the java application that runs solr
# Do this in another terminal window & keep it running
# If you see error output, somethings wrong
cd /opt/solr/example
sudo java -jar start.jar

Index the database

# back in the chi-councilmatic directory:
python rebuild_index

OPTIONAL: Install and configure Jetty for Solr

Just running Solr as described above is probably OK in a development setting. To deploy Solr in production, you'll want to use something like Jetty. Here's how you'd do that on Ubuntu:

sudo apt-get install jetty

# Backup stock init.d script
sudo mv /etc/init.d/jetty ~/jetty.orig

# Get init.d script suggested by Solr docs
sudo cp solr_scripts/ /etc/init.d/jetty
sudo chown root.root /etc/init.d/jetty
sudo chmod 755 /etc/init.d/jetty

# Add Solr specific configs to /etc/default/jetty
sudo cp solr_scripts/jetty.conf /etc/default/jetty

# Change ownership of the Solr directory so Jetty can get at it
sudo chown -R jetty.jetty /opt/solr

# Start up Solr
sudo service jetty start

# Solr should now be running on port 8983

Regenerate Solr schema

While developing, if you need to make changes to the fields that are getting indexed or how they are getting indexed, you'll need to regenerate the schema.xml file that Solr uses to make it's magic. Here's how that works:

python build_solr_schema > solr_scripts/schema.xml
cp solr_scripts/schema.xml /opt/solr/solr/collection1/conf/schema.xml

In order for Solr to use the new schema file, you'll need to restart it.

Using Solr for more than one Councilmatic on the same server

If you intend to run more than one instance of Councilmatic on the same server, you'll need to take a look at this README to make sure you're configuring things properly.


  • David Moore - project manager
  • Forest Gregg - Open Civic Data (OCD) and Legistar scraping
  • Cathy Deng - data models and loading
  • Derek Eder - front end
  • Eric van Zanten - search and dev ops

Errors / Bugs

If something is not behaving intuitively, it is a bug, and should be reported. Report it here:


Copyright (c) 2015-17 Participatory Politics Foundation and DataMade. Released under the MIT License.

You can’t perform that action at this time.