Lots of websites have polls, usually as a little side bar. But most of those polls are based on plurality voting, an inferior voting method. Approval_frame is a replacement for those polls, using approval voting, which is suitable for embedding in other webpages via an iframe tag. The project, taken as a whole, will serve these approval-based webpolls, or the approval_polls package contained within it can be added to other Django-based servers to be used locally.
Option 1 : Manually install the following
Option 2 (Recommend) : Use virtualenv and pip
To learn more about why virtualenv and pip should be used, refer - A non-magical introduction to Pip and Virtualenv for Python beginners
- Install Python 2.7 from the link in step 1 above.
- Install pip globally
sudo apt-get install python-pip
. - Install virtualenv globally
sudo pip install virtualenv
. - Enter the directory that contains this readme file.
- Create a new virtual environment
virtualenv env
. - Activate the virtual environment
source env/bin/activate
- Install the dependencies
pip install -r requirements.txt
When you're done working on the project, you can quit the virtualenv by running deactivate
.
-
Install git. If you're new to git then the Pro Git book is useful.
-
Clone this repository.
git clone https://github.com/electology/approval_frame.git
. -
Go into the approval_frame directory.
cd approval_frame
. -
For the registration procedure to work correctly, fill-in the following email configuration in approval_frame/settings.py
EMAIL_USE_TLS = True
EMAIL_HOST = hostname of the smtp server
EMAIL_PORT = 587
EMAIL_HOST_USER = the username on the smtp server
EMAIL_HOST_PASSWORD = the password for the username
-
Before you run the Django server for the first time, you'll need to create the database tables:
python manage.py syncdb
This will ask you to create a superuser account, which is necessary if you want to use the Django admin interface. But also, you'll need a user account in order to create polls in the system, and it's easiest to do that here. (If you don't create an account here, you'll have to mess around copying urls from from the server output to fake confirming an email address in order to create a user account later... so just do it now.)
-
Start the Django server:
python manage.py runserver
-
Change the domain name of the site
example.com
toyourdomainname
in the admin panel so that the activation emails have the correct url. -
Finally, see how it looks. In your favorte browser, go to the link:
<your domain name>:<port>/approval_polls
If you're running the server locally then this would be
http://localhost:8000/approval_polls
There won't be any polls yet, but you can login with the superuser account you created. Then you should be able to create polls, vote in them, and see the results.
- If you're new to Python, Google's Python tutorial gives a basic introduction to the language. There are several other tutorials available on the web.
- If you're new to Django, the tutorial on Django's documentation page is very comprehensive. In fact, through a happy coincidence, it uses a poll application as an example. This project is heavily based on that tutorial.
- If you're new to git, as mentioned above, the Pro Git book is very useful.
- In order to contribute, please follow the fork-and-pull-request model as documented here.
All contributions are welcome.
Have a question? Want to discuss something? Head over to the forum at https://groups.google.com/forum/#!forum/ces-software.