PyVotons Documentation (Web Version)
Development status
PyVotons web version is more or less on standby, waiting for me to get some free time (in short supply…). It is not really usable: GUI is not complete, it needs a coder to install it, it is not complete, and security concerns have not all been addressed.
Please try to use it if you want to help the development !
Structure
PyVotons is written in Python, using the Pyjamas library for the web interface (maybe should be rewritten directly in JS ? PyJs does not seem very alive today…).
The backend uses a python HTTPS server taken from someone else.
There are two parts : the server-side and the client-side code (written in Python and translated by Pyjamas to html + javascript + css).
All this is included in a python module “pyvotons” that contains “ui” (client-side code), “server”, “db”, “core”, “test”.
Installation
SQL database
Configuration and db initialization : install a MySQL database (it should work with minimal work with any SQL-based database), create a database named pyvotons, create a pyvotons user/password, then execute createTables.sql
This will create the necessary tables, and add the first user.
There is no admin/ordinary user distinction right now, users
Server
This should just be a matter of unpacking the pyvotons directory in the install directory. But right now, there is no preference file, so you must edit directly the source code to adapt it to your needs. (Yes this is bad…)
You have to edit the code in JSONserverManik.py to change the wwwDir variable to the path to the web files (client-side code). If you want the serveur to run on something else than localhost:8000, you’ll have to edit one of the last lines:
server = ThreadedHTTPServer((‘localhost’, 8000), ElectionWebServiceHandler)
You must also edit DataService.py in the connectDB function if you did not use ‘pyvotons’ for the db name/db user name/db password
You now have to generate HTTPS keys (check INSTALL_HTTPS file for instructions)
You are done, just edit and execute launchServer.sh (you have to update the PYTHONPATH variable in the file to have it point to the installation directory)
Client
If you don’t need/want to change the source code, just use the compiled html and js files in the ui/output directory (see Server).
If you want to modify the code, go into “ui/pyjamas” : all python files are the source of the UI. build.sh allows to compile it to JS. “public” directory contains elements that will be included in the final files (such as CSS for styling UI elements)
Usage
– Connect to the server with a web browser with the URL https://localhost:8000/MainMenuPage.html
– Create an account or log in
– See the Main Menu
– Create a scrutin
– Available types of scrutin/votes
– QuickVote/QuickResult
[… To be continued …]