This repository has been archived by the owner. It is now read-only.
A CRUD admin for editing AP election results data, including names and race calls.
HTML Python
Switch branches/tags
Nothing to show
Clone or download
Jasmine Lee
Jasmine Lee adding 06-13
Latest commit 3b86e96 Jun 8, 2017

README.md

logo

elex-admin is a lightweight, Flask-based CRUD admin for election results data loaded with elex-loader and elex.

Getting started

  • Set up software and environment.
git clone git@github.com:newsdev/elex-admin.git && cd elex-admin
mkvirtualenv elex-admin
pip install -r py3.requirements.txt

Add a new racedate to the admin

  • Duplicate the most recent racedate.ini file in elex_admin/. Name it with your new racedate.
  • In that file, increment the http-socket port by 1 (eg. 127.0.0.1:8047 -> 127.0.0.1:8048)
  • Edit elex_admin/races.conf: Duplicate the last location {} object and change the racedate and proxy_pass port number to match the settings in the .ini file you just made.
  • Then run these commands:
workon elex-admin
fab e:stg master pull
fab e:prd master pull

You'll then want to go run the elex-dotfiles commands to turn on the new racedate in the admin.

Running the admin

  • This project requires Adcom for its theme. You can deploy Adcom to a CDN like Amazon S3 and then specify the root of the URL in an environment variable.
export RACEDATE=2016-02-01
export ELEX_ADMIN_CDN_URL=http://my.cdn.url.com/cdn
  • Run bootstrap.sh, init.sh and update.sh from elex-loader.

  • Run python elex_admin/initialize_racedate.py to set up candidates and races for overrides.

  • Run the admin.

python -m elex_admin.app

See all races for a racedate

screenshot

Edit candidate information and make race calls

screenshot