Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
121 lines (82 sloc) 3.38 KB
Django Cal-Access Lobbying Activity
**django-calacces-lobbying-activity** is a simple Django app to lobbying activity data from the cal access database. It is reliant on
`django-calaccess-parser <>`__.
Detailed documentation is in the "docs" directory. *(coming soon)*
- Django 1.6
- `django.contrib.humanize <>`__
- MySQL 5.5
- `django-calaccess-parser <>`__
- Patience
- Install django-calaccess-browser with pip
.. code:: bash
$ pip install django-calaccess-lobbying-activity
- Add ``lobbying`` to your INSTALLED\_APPS setting like this:
.. code:: python
Setup urls
In your project ````:
.. code:: python
urlpatterns = patterns('',
url(r'^browser/', include('lobbying.urls')),
Loading the data
- Next, sync the database, create a Django admin user, and run the
management command to extract campaign finance data from from the raw
calaccess data dump.
.. code:: bash
$ python syncdb
$ python build_lobbying
:warning: This'll take a while. Go grab some coffee or do something
else productive with your life.
The JavaScript and CSS for the project is managed with Grunt and Bower.
Currently, the JavaScript and SCSS dependencies are not included so
you'll need to build them yourself;
1. Install `Node.js <>`__ (this will also include NPM)
2. Install Grunt and bower globally with
``npm install -g bower grunt-cli``
3. Go to the ``static`` directory and install the required dependencies
with ``npm install && bower install``
4. Generate the ``main.css`` file and watch for HTML, CSS and JavaScript
changes by executing ``grunt``
Explore data
Start the development server and visit to
inspect the Cal-access data.
django-calaccess-browser uses django-tastypie to expose the data as an
API. Add ``tastypie`` to the project ``INSTALLED_APPS`` and make sure
you included ``lobbying.urls`` in your project's ````.
From there visit
` <>`__
to explore the JSON representation of the data.
You can also export the data into easily queryable flat files.
.. code:: bash
$ python export_lobbying
Update the data
When you are ready to get new data, just blow away both the parser and
the campaign finance browser app. Then reload them.
You can do something like this, making sure you fill in your database
and user names correctly.
``bash $ python sqlclear calaccess | mysql -u user_name -p database_name $ python sqlclear lobbying | mysql -u user_name -p database_name $ pytnon syncdb $ python downloadcalaccess && python build_lobbying``
- `Agustin Armendariz <>`__
- `Ben Welsh <>`__
- `Aaron Williams <>`__