How to contributeΒΆ

This walkthrough will show you how to install the source code of this application to fix bugs and develop new features.

First create a new virtualenv.

$ virtualenv django-calaccess-lobbying-activity

Jump in.

$ cd django-calaccess-lobbying-activity
$ . bin/activate

Clone the repository from GitHub.

Make sure you have the django-calaccess-parser installed otherwise NONE OF THIS WILL WORK.

$ git clone https://github.com/california-civic-data-coalition/django-calaccess-lobbying-activity.git repo

Move into it and install the Python dependencies.

$ cd repo
$ pip install -r requirements_dev.txt

Make sure you have MySQL installed. If you don’t, now is the time to hit Google and figure out how. If you’re using Apple’s OSX operating system, you can install via Homebrew. If you need to clean up after a previous MySQL installation, this might help.

Then create a new database named lobbying.

mysqladmin -h localhost -u root -p create lobbying

If you have a different username, substitute it above. You’ll be prompted for that user’s mysql password.

Then create a file at example/project/settings_local.py to save your custom database credentials. That might look something like this.

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'lobbying',
        'USER': 'yourusername', # <-- This
        'PASSWORD': 'yourpassword', # <-- And this
        'HOST': 'localhost',
        'PORT': '3306',
        'OPTIONS': {
            'local_infile': 1,
        }
    }
}

Finally create your database and get to work.

$ python example/manage.py syncdb

You might start by loading the data dump from the web.

$ python example/manage.py downloadcalaccess

Then you can build the lobbying activity models

$ python example/manage.py build_lobbying