datamade/openness-project-nmid

Name: openness-project-nmid

Owner: datamade

Description: The Openness Project - New Mexico In Depth Campaign Finance Explorer

Created: 2016-07-05 18:32:09.0

Updated: 2018-05-18 19:46:01.0

Pushed: 2018-05-18 19:45:59.0

Homepage:

Size: 493415

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

The Openness Project - New Mexico Campaign Finance Site

This site brings greater transparency to New Mexico politics by providing an overview of campaign contributions, expenditures, and the people, businesses, and organizations involved.

Setup

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, do this:

rtualenv openness-project-nmid -p /path/to/your/python3
clone https://github.com/datamade/openness-project-nmid.git
penness-project-nmid
install -r requirements.txt

Next, change your application settings. Start by copying the example settings_local_example.py

mid/settings_local_example.py nmid/settings_local.py

Then set your database name, user and password.

Next, create a postgres database and run the Django migrations to setup the proper tables.

tedb nmid
on manage.py migrate
Data import

To import the New Mexico campaign finance data into your database, run the import_data command:

on manage.py import_data

The version of the data sent to us by the Secretary of State in April 2018 contains a number of errors - primarily candidates that are assigned to the wrong race. To fix these errors, run the edit_data command:

on manage.py edit_data

Next, group campaigns into races with the make_races command.

on manage.py make_races

Finally, run the make_search_index command to generate the search index.

on manage.py make_search_index
Redoing an import

The data import scripts for this app will automatically recognize if you have data imported, and add or update new data accordingly. However, if you'd like to start over from scratch but don't want to delete your user and page data, you can start by running the flush_camp_fin command to flush campaign finance data from the database:

on manage.py flush_camp_fin
Run the code

Run the server with the following:

on openness-project-nmid
on manage.py runserver

Then, navigate to: http://localhost:8000/

Team
Errors / Bugs

If something is not behaving intuitively, it is a bug, and should be reported. Report it here: https://github.com/datamade/openness-project-nmid/issues


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.