Sign inSign up

rjw57/psephology

By rjw57

•Updated about 9 years ago

Example webapp for collecting election results

Image
0

928

rjw57/psephology repository overview

⁠Psephology - the study of elections

Build
Status Coverage
Status Documentation
Status Docker Build
Statu

Psephology is an experimental webapp for recording election results. For more information take a look at the documentation⁠.

⁠Getting started

The documentation⁠ includes a simple getting started guide which covers building a Docker container to host the application. The information below is of more use if you are working on the project and want to run a local development server.

⁠Short, short version
$ docker pull rjw57/psephology
$ docker run -it --rm --name psephology-server -p 5000:5000 rjw57/psephology

In another terminal:

$ docker exec psephology-server flask db upgrade

Now visit http://localhost:5000/⁠ or, if you're using docker-machine⁠:

$ xdg-open http://$(docker-machine ip):5000/    # Linux-y
$ open http://$(docker-machine ip):5000/        # OS X
⁠Local server

You need to run flask db upgrade before running the server:

$ export PSEPHOLOGY_CONFIG=$PWD/config.py
$ export FLASK_APP=psephology.autoapp
$ export FLASK_DEBUG=1
$ flask db upgrade
$ flask run

The config.py file should look something like the following:

from psephology.config.dev import *

# Any custom config here

⁠New results

New results can be imported via the importresults CLI command. For example:

$ flask psephology importresults test-data/ge2017_results.txt

⁠Running tests

Tests are run via the setup.py script. When the Docker container is built, tests are run within it.

$ python setup.py test

Tag summary

Content type

Image

Digest

Size

271 MB

Last updated

about 9 years ago

docker pull rjw57/psephology