Django Delegate Voting System
A barebones simple majority voting system with delegates created as a proof of concept.
The main goals to be proved were that it is possible and easy to build a system like this on a standard stack that everybody can understand and deploy without too much hassle.
- Create generic views and templates to make this work in the browser.
- Wrap critical sections in a transaction
- Make a celery worker that does the resolution of votes when proposals close.
- Integrate more advanced voting methods using: https://github.com/bradbeattie/python-vote-core
This is all standard django setup as explained here: https://devcenter.heroku.com/articles/django
- Install homebrew, by getting the commandline tools: https://developer.apple.com/downloads and then do the install homebrew here: http://mxcl.github.com/homebrew/ (I don't think this is require but the XCode Command Line Tools are.)
- Open Terminal.app
- Check python is installed by typing
- Install pip if you don't have it
sudo easy_install pip
- Use pip to install virtualenv (don't ask me why):
sudo pip install virtualenv
- Find a fresh place to checkout the project: email@example.com:alper/enhydris.git use the Mac client: http://mac.github.com/
- In the terminal
cdto where you just checked out the project, for instance:
- Create a virtual environment if you don't have one yet:
virtualenv venv --distribute
- Start a virtual environment:
- Install all the necessary packages:
pip install -r requirements.txt
- If you have never done so, setup the database:
python manage.py syncdb, follow the instructions you get and note down the username and password that give you /admin access to the django site
- Because we use south to create the tables for the application (and to update after model changes) you need to run:
python manage.py migrate
- Start the server with
python manage.py runserverand go to your django at http://127.0.0.1:8000/admin
- Run the nose test by typing: python manage.py test --nologcapture
To restart the server simply repeat steps 9 and 13. To be up to date again always do: 9, 10, 12, 13.