All Projects → praekelt → Django Likes

praekelt / Django Likes

Licence: other
Django app providing view interface to django-secretballot.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Likes

Djangoforbeginners
Source code for Django For Beginners
Stars: ✭ 527 (+631.94%)
Mutual labels:  django-application, django
Django Spectator
A Django app to track book reading, and event going.
Stars: ✭ 28 (-61.11%)
Mutual labels:  django-application, django
E Commerce 2 django
Guest register, user register, user login, user logout, account home page, product view history, change password, reset password, change name, send activation email when register, resend activation email, add shipping address, add billing address, add nickname to the addresses, edit shipping address, edit billing address, view list of your addresses, reuse shipping addresses when order products, reuse billing addresses when ordeer products, show sales analytics if staff or admin only using -chart.js-, get analytics data with Ajax, receive marketing email, change if user will receive marketing email or not by admin, send contact message with Ajax, products list, product detail, download product detail as a PDF file, download digital product files -if the user purchased that digital product only-, orders list, list of digital products files, order detail, download order detail as a PDF file, verify order ownership with Ajax -to secure order detail page-, show cart products, add or remove product from cart, checkout page, thanks page when order placed successfully, add or reuse payment method, add or reuse payment method with Ajax, search products by title, search products by description, search products by price, search products by tag title, write tags for products -by admin only-, auto fill contact email, full name if user logged in.
Stars: ✭ 20 (-72.22%)
Mutual labels:  django-application, django
Django Ledger
A bookkeeping & financial analysis engine for the Django Framework. UNDER ACTIVE DEVELOPMENT & NOT STABLE YET.
Stars: ✭ 253 (+251.39%)
Mutual labels:  django-application, django
Django Preferences
Django app allowing users to set app specific preferences through the admin interface.
Stars: ✭ 51 (-29.17%)
Mutual labels:  django-application, django
Django Easy Audit
Yet another Django audit log app, hopefully the simplest one.
Stars: ✭ 289 (+301.39%)
Mutual labels:  django-application, django
Awesome Django Cn
Django 优秀资源大全。
Stars: ✭ 1,153 (+1501.39%)
Mutual labels:  django-application, django
Django Settings Export
Access Django settings from templates the right way™
Stars: ✭ 167 (+131.94%)
Mutual labels:  django-application, django
Django Rename App
A Django Management Command to rename existing Django Applications.
Stars: ✭ 38 (-47.22%)
Mutual labels:  django-application, django
Algo Phantoms Backend
💻 Algo-Phantoms-Backend is an Application that provides pathways and quizzes along with a code editor to help you towards your DSA journey.📰🔥 This repository contains the REST APIs of the application.✨
Stars: ✭ 36 (-50%)
Mutual labels:  django-application, django
Django Rest Registration
User-related REST API based on the awesome Django REST Framework
Stars: ✭ 240 (+233.33%)
Mutual labels:  django-application, django
Taggit Selectize
Auto-complete/auto-suggestion for django-taggit (django-taggit + selectize.js)
Stars: ✭ 63 (-12.5%)
Mutual labels:  django-application, django
College Erp
A college management system built using Django framework. It is designed for interactions between students and teachers. Features include attendance, marks and time table.
Stars: ✭ 187 (+159.72%)
Mutual labels:  django-application, django
Meethub
This is a Python/Django based event management system. A meetup clone.
Stars: ✭ 411 (+470.83%)
Mutual labels:  django-application, django
Niji
A pluggable Django forum APP
Stars: ✭ 173 (+140.28%)
Mutual labels:  django-application, django
Djangorestframework Book
Django REST framework 3 中文文档, API参考, 最佳实践指南
Stars: ✭ 28 (-61.11%)
Mutual labels:  django-application, django
Django mail admin
The one and only django app to receive & send mail with templates and multiple configurations.
Stars: ✭ 140 (+94.44%)
Mutual labels:  django-application, django
Patchman
Patchman is a Linux Patch Status Monitoring System
Stars: ✭ 163 (+126.39%)
Mutual labels:  django-application, django
Django Djeddit
Minimalistic Reddit clone developed as a Django reusable app
Stars: ✭ 32 (-55.56%)
Mutual labels:  django-application, django
Open Semantic Search Apps
Python/Django based webapps and web user interfaces for search, structure (meta data management like thesaurus, ontologies, annotations and named entities) and data import (ETL like text extraction, OCR and crawling filesystems or websites)
Stars: ✭ 55 (-23.61%)
Mutual labels:  django-application, django

Django Likes

Django app providing view interface to django-secretballot.

.. image:: https://travis-ci.org/praekelt/django-likes.svg?branch=develop :target: https://travis-ci.org/praekelt/django-likes?branch=develop

.. image:: https://coveralls.io/repos/github/praekelt/django-likes/badge.svg?branch=develop :target: https://coveralls.io/github/praekelt/django-likes?branch=develop

.. image:: https://badge.fury.io/py/django-likes.svg :target: https://badge.fury.io/py/django-likes

This app utilizes Django Secretballot <http://pypi.python.org/pypi/django-secretballot/>_ to provide Facebook or Google+1 style item liking of Django model objects. Authenticated or anonymous users are allowed to like any given object only once.

.. contents:: Contents :depth: 5

Requirements

#. Python 2.7, 3.5-3.7

#. Django 1.11, 2.0, 2.1

#. django-secretballot 1.0.0

Installation

#. Install or add django-likes to your Python path.

#. Configure django-secretballot as described here <http://pypi.python.org/pypi/django-secretballot/>_.

#. Add likes to your INSTALLED_APPS setting.

#. Add likes url include to your project's urls.py file::

url('likes/', include('likes.urls')),

#. Add likes.middleware.SecretBallotUserIpUseragentMiddleware to your MIDDLEWARE_CLASSES setting, i.e.::

MIDDLEWARE_CLASSES = (
    ...other middleware classes...
    "likes.middleware.SecretBallotUserIpUseragentMiddleware",
)

#. Make sure django.template.context_processors.request is in your TEMPLATES['OPTIONS']['context_processors'] setting.

Usage

Template Tags


{% likes object %}
+++++++++++++++++
django-likes provides an inclusion tag called ``likes`` which renders a like button for any given object, displaying the number of likes and allowing users to like the object. The tag accepts as first argument the object for which to display and on which to apply likes, i.e.::

    {% load likes_inclusion_tags %}

    ...some html...

    {% likes object %}

    ...some more html...

``object`` here is any Django model object for which `django-secretballot <http://pypi.python.org/pypi/django-secretballot/>`_ voting has been enabled. In the background the like is uniquely addressed to the object using its content type and object id.

.. note::

    In order for the ``likes`` tag to work the request object needs to be available within the template's context. Thus you have to use `RequestContext <https://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext>`_ in your views to construct context, which, combined with the ``django.core.context_processors.request`` context processor, will ensure the request object is available as part of the context.

The template tag supports AJAX style liking. To enable it you need ensure django-likes' static media is accessible, see `managing static files <https://docs.djangoproject.com/en/dev/howto/static-files/>`_. You also need to load jQuery somewhere in your template, e.g.::

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"></script>

Signals
~~~~~~~
likes.signals.likes_enabled_test
++++++++++++++++++++++++++++++++
To determine whether or not liking/voting should be enabled on an object, connect a signal handler to the ``likes.signals.likes_enabled_test`` signal, raising a ``likes.exceptions.LikesNotEnabledException`` if liking should be disabled. The default behaviour is that liking is enabled for all secretballot enabled objects.

likes.signals.can_vote_test
+++++++++++++++++++++++++++
To determine whether or not the current requesting user can vote, connect a signal handler to the ``likes.signals.can_vote_test`` signal, raising a ``likes.exceptions.CannotVoteException`` if the current user should not be allowed to vote (the handler receives a request object). The default behaviour is that all users can vote except if they have previously voted on the object in question.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].