Source

django-poll-system / README.TXT

Full commit
RafRaf 3ef362a 
RafRaf d516c9d 



RafRaf 3ef362a 
RafRaf 9fae66f 
RafRaf d516c9d 


RafRaf 3ef362a 

RafRaf 15fbe06 
RafRaf d516c9d 
RafRaf 3ef362a 
RafRaf d516c9d 














RafRaf 3ef362a 
RafRaf d516c9d 



















RafRaf 3ef362a 
RafRaf ed29ad2 

RafRaf 3ef362a 



RafRaf ed29ad2 





RafRaf 9fae66f 
RafRaf d516c9d 


RafRaf 3ef362a 
RafRaf d516c9d 
RafRaf ae23410 
RafRaf 3ef362a 















Django-poll-system (example: http://polltest.pythonism.ru)


Requirements

Django 1.3 or 1.4
JQuery (There are some problems with animation in older versions.) 

Installation

1. Install the package into your ecosystem
    >> easy_install django_poll_system 


2. Add it to your INSTALLED_APPS (in settings.py), like this:

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',

'poll',
)


3. 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

admin.autodiscover()

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()


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

TEMPLATE_CONTEXT_PROCESSORS = (
    # Uncomment for Django 1.3
	#'django.core.context_processors.auth',
	# Uncomment for Django 1.4
	#'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.i18n',
    'django.core.context_processors.request',
    'django.core.context_processors.static',
) 


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


5. Now installation is completed. After all you need to create a queue of polls and at least one poll for it.  


6. Insert the component into your page. Use the code snippet below to understand how to do that.  

{% load polls_tags %}
<html>
	<head>
		<title>Test page</title>
		<script type="text/javascript" src="{{ STATIC_URL }}path_to_jquery/jquery.js"></script>
	</head>
	<body>
		<h1>Test page</h1>
		{% poll_queue "YourQueueName" %}
	</body>
</html>


================================
That's all. Try it: http://polltest.pythonism.ru. (Please, leave your comments there)