Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (50 sloc) 1.65 KB

Django Easy Poll

|Build Status| |Version| |Python| |Size| |Codecov|

Installation

pip install django-easy-poll

Install latest from github:

sudo pip install -e git+https://github.com/hmtanbir/django-easy-poll.git#egg=django-easy-poll

Requirements

Django 1.10+, Python 2.7, 3.4+

Usage

  1. Add 'poll' application in the INSTALLED_APPS settings:

    INSTALLED_APPS = (
        ...
        'poll',
    )
    
  2. Add the poll's url to your urls.py.

    urlpatterns = [
        ...        
        url(r'^', include("poll.urls", namespace='poll')),
    ]
    
  3. Run python manage.py migrate poll

  4. Go to site's admin area and create a new poll:

screenshot from 2018-02-20 09-01-26

  1. Add this tags in your template file to show the poll:

    {% load poll_tags %}
    ...
    {% poll %}
    
  2. Check if jQuery is already included on the page. If don't — add it:

<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
  1. Make vote:

screenshot from 2018-02-20 09-03-04

  1. See the results:

screenshot from 2018-02-20 09-06-12

Customization

Of course, you can (and probably, should) customize Easy Poll's templates. You can easily do this by overriding base.html, poll.html and result.html in templates/poll directory.

You can’t perform that action at this time.