Skip to content

Elections Spring 2015

Brian Frank edited this page Apr 27, 2015 · 4 revisions

INSTALLATION

(These instructions assume you have set up an environment for accountability tracker, are working in that environment, and have installed all the requirements from requirements.txt)

  1. If you don't have accountability-tracker installed, clone it to a new directory, then proceed to Step 2. Otherwise start with Step 3
  2. You'll 'development.yml' and 'fabfile.py' - ask and someone can email copies. Put these files in the main accountability-tracker directory.
  3. In 'development.yml' change the 'build_dir' to your own folder in the 'static-projects' app. i.e. in the directory string, change frank to your name and leave the rest alone. If you don't have your own static-projects test directory, create one
  4. Create the following folder structure in your folder in static-projects...should be yourname/california-elections-guide/2015/municipal
  5. In 'development.yml' add the following views to 'build:views' (for efficiency, you can disable any other views while working on this project):
    - "elections_spring2015.views.PasadenaListView"
    - "elections_spring2015.views.LosAngelesListView"
  1. Make sure the following command is in fabfile.py and, if not, add it:
def springscrape():  
    """  
    scrape candidate data from SmartVoter.org  
    """  
    local("python manage.py spring2015_scraper")
  1. Check out the 'dev-election-profiles' branch
  2. If you already have an 'elections_spring2015' database table, you can skip to Step 10.
  3. If you don't have the 'elections_spring2015' table in your database, create one, then delete the existing 'migrations' folder in that app and do an initial migration (python manage.py makemigrations elections_spring2015 followed by python manage.py migrate)
  4. In the terminal, run fab springscrape to grab the first batch of candidates and contests from SmartVoter. Repeat this command once per day. If it finds any new/changed information, then proceed to Step 11.
  5. In terminal, run fab build to build the new static pages. Test the new pages to ensure they're working properly, and then transfer them from your build directory to the working app directory, static-projects/applications/california-elections-guide/2015/municipal. NOTE: Some extra files may be created, so be sure to look to the existing app directory and check css/images/etc. in the static files directory to see what you'll need to bring over.