-
Notifications
You must be signed in to change notification settings - Fork 1
Elections Spring 2015
Brian Frank edited this page Apr 27, 2015
·
4 revisions
(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)
- If you don't have accountability-tracker installed, clone it to a new directory, then proceed to Step 2. Otherwise start with Step 3
- You'll 'development.yml' and 'fabfile.py' - ask and someone can email copies. Put these files in the main accountability-tracker directory.
- 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 - Create the following folder structure in your folder in static-projects...should be
yourname/california-elections-guide/2015/municipal
- 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"
- 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")
- Check out the 'dev-election-profiles' branch
- If you already have an 'elections_spring2015' database table, you can skip to Step 10.
- 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 bypython manage.py migrate
) - 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. - 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.