Skip to main content

A concrete poll app allowing CRUD functionality in the admin and front-end with JQPLOT integration, please download separately.

Project description

django-poll
-----------
1. django-admin.py startproject project
2. Configure your database in your settings file:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'project.db',
}
}

3. Install the package to your python site-packages folder or just use it as a module in your project.
4. Add 'polls' to INSTALLED_APPS in your settings file.
5. Install django-coffee, https://pypi.python.org/pypi/django-coffee/0.0.3, to your python site-packages folder or just use it as a module in your project.
5. Install django-paginate, https://pypi.python.org/pypi/django-paginate/0.0.1, to your python site-packages folder or just use it as a module in your project.
7. Add 'django.contrib.admin' to INSTALLED_APPS in your settings file.
8. Configure your settings file further:
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.request',
'django.core.context_processors.static',
'django.contrib.messages.context_processors.messages'

9. In settings.py remember to configure LOGIN_URL
10. python manage.py migrate --run-syncdb --settings=project.settings

11. In your projects urls add the following code:

from project.polls import urls as poll_urls

urlpatterns = patterns('',
...
url(r'^poll/', include(poll_urls)),
url(r'^admin/', include(admin.site.urls)),
...
)

12. python manage.py runserver --settings=project.settings
13. http://127.0.0.1:8000/admin, login first
14. In the admin you'll see the polls app.
15. While logged in go to, http://127.0.0.1:8000/poll and add a poll.
16. Goto, http://www.jqplot.com/ and download jqplot. Then add it to you static js directory only the files needed as shown in polls/results.html.
17. Add the optional POLL_ANONYMOUS_VOTING_ENABLED = True in your settings file, flag to incorporate Anonymous voting on your system. Tracking of Anonymous votes will be done in next release.
When thjis flag is added can also add the following in the settings file:
1. SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies", to choose what session engine you want to use to see whether an anonymous user has voted or not.
2. POLL_ANONYMOUS_SESSION_AGE = 3*24*60*60, this will set the expiration age to 3 days before a anonymous user can vote again, if not supplies default to 0.
18. Run syncdb again when upgrading rather than re-installing, to get the AnonymousUserChoice model in working.
19. Make sure to download bootstrap and add the necessary files to base_site.html.
20. If you need to make use of a sign-in, sign-up package, django-user 0.0.2 is ideal.
21. You can now also view charts in the admin.
22. Add optional customizable messages to your settings file, POLL_MESSAGE_ADD, POLL_MESSAGE_UPDATE, POLL_MESSAGE_VOTE, POLL_MESSAGE_VOTE_ERROR_CHOICE_SELECTION, POLL_MESSAGE_VOTE_ERROR_ALREADY_VOTED.
23. Django 1.9 compatible
24. See http://pythonhosted.org/django-poll, for a showcase


Changelog
---------
0.0.3
Minor cleanup
Minor bug fix. Set proper message when no option is selected when voting on poll

0.0.4
Minor tags and methods included with showcase in templates

0.1.0
JQPLOT integration

0.1.1
Anonymous voting and PEP 8

0.1.2
Anonymous voting using sessions cookies to determine whether an anonymous user has voted or not.
Tracking of Anonymous user votes.

0.1.3
django-poll now bootstrapped! Just a simple implementation.

0.1.4
Charts in the admin

0.1.5
Optional customizable messages

0.2.0
Depends now on django-coffee.

0.2.1
Detection of checkboxes + radio inputs with django-coffee.

0.2.2
Depends now on django-coffee templates.

0.2.3
Ajax implemenation of voting

0.2.4
Ajax messages fixes, if ajax don't work for you just remove ajax script.

0.2.5
Ajax fixes, pagination, POLL_PAGE_COUNT option

0.2.6
Depends on django-paginate

0.2.7
More chart options and fixes of bugs that krept in.

0.2.8
Front-end poll removal functionality.

0.2.9
{% static 'your url' %} added

0.3.0 Make it usable only to Django >= 1.9

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-poll, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size django-polls-0.3.0.tar.bz2 (40.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page