JostCrow / django-reviewing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django Reviewing

Build Status codecov Lintly

Installation

Install with pip

pip install django-reviewing

Add 'django-reviewing' to the installed apps

# settings.py

INSTALLED_APPS = [
    ...
    'reviews',
    ...
]

Settings

There are several settings which you can use within settings.py:

    # If you want different scores to show.
    SCORE_CHOICES = (
        (1, _(u"*")),
        (2, _(u"**")),
        (3, _(u"***")),
        (4, _(u"****")),
        (5, _(u"*****")),
    )

Usage

Add the provided tags to your templates

    {% load reviews_tags %}

    <html>
        <head>
            <title>{{ flatpage.title }}</title>
        </head>
        <body>
            {{ flatpage.content }}
            {% average_for_instance flatpage %}

            <hr>
            {% reviews_for_instance flatpage %}

        </body>
    </html>

Example

There is a simple example provided with this product.

To install it just make sure django.contrib.flatpages has been installed (a flatpage will serve as our test content) and add reviews.example to INSTALLED_APPS.

Now add a flatpage and browse to it. You should be able to add reviews to the flatpage now.

About

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%