Example webapp for collecting election results
928
Psephology is an experimental webapp for recording election results. For more information take a look at the documentation.
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.
$ 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
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 can be imported via the importresults CLI command. For example:
$ flask psephology importresults test-data/ge2017_results.txt
Tests are run via the setup.py script. When the Docker container is built,
tests are run within it.
$ python setup.py test
Content type
Image
Digest
Size
271 MB
Last updated
about 9 years ago
docker pull rjw57/psephology