1. Rafael A
  2. django-poll-system


django-poll-system / README.TXT

Rafael A d516c9d 

Rafael A fddc4a7 
Rafael A d516c9d 

Rafael A 15fbe06 

Rafael A d516c9d 

Rafael A ed29ad2 

Rafael A fddc4a7 
Rafael A d516c9d 
Rafael A fddc4a7 
Rafael A ed29ad2 
Rafael A d516c9d 

Django poll system


Django 1.3
JQuery (http://jquery.com/)
Django Internationalization (optionally)


Download or clone repository into the folder you like. Unpack it if needed and make an installation. The installation is simple, just type next command:
   >> python setup.py install

Now you should config your site to use the poll application. Follow instructions below:

1. Add the name of the application at the end of your INSTALLED_APPS (in settings.py), like this:



2. Add the poll's url to your urls.py.

from django.conf.urls.defaults import patterns, include, url

from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from views import TestView


urlpatterns = patterns('',
    url(r'^$', TestView.as_view(), name='home'),
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', include(admin.site.urls)),

    url(r'^poll/', include('poll.urls')),

urlpatterns += staticfiles_urlpatterns()

3. Your TEMPLATE_CONTEXT_PROCESSORS (in settings.py) should looks like this:


4. Run 'collectstatic' to deploy poll's static files (see https://docs.djangoproject.com/en/1.3/howto/static-files/#deploying-static-files-in-a-nutshell)
   >> python manage.py collectstatic

5. Eventually we need to do "syncdb".
   >> python manage.py syncdb

ATTENTION: Don't forget this step. It's very important, because django-poll-system have a fixture that needs to be installed to DB.


Now installation is complete. After all, you have some data out of the box. And it's time to show the poll on your site. Add {% load polls_tags %} at the top of your page and insert {% poll_queue 'Public' %} to the place you want to see it. Of course the script of JQuery library must be included (<script type="text/javascript" src="your/path/to/jquery.js"></script>) before you call "poll_queue".

That's all. Try an example: http://polltest.pythonism.ru