Package: django-generic-tagging
Authorgiginet <giginet.net@gmail.com>Supported python versions3.3, 3.4, 3.5Supported django versionsDjango 1.7 - 1.9A generic tagging library which enables to attach tags for every objects.Sample Applicationhttps://django-generic-tagging.herokuapp.com/InstallationUsepiplike:$ pip install django-generic-taggingRequirementsdjangorestframeworkjQuery 1.x / 2.xUsageYou should refer the example application for detail.ConfigurationPutgeneric_tagginginto yourINSTALLED_APPSat settings moduleINSTALLED_APPS=(...'generic_tagging',)Add URL patterns into yoururls.pyfromdjango.conf.urlsimportinclude,urlfromdjango.contribimportadminfromgeneric_tagging.api.routersimportTaggingAPIRoutertagging_router=TaggingAPIRouter(trailing_slash=True)urlpatterns=[...url(r'^tags/',include('generic_tagging.urls')),url(r'^api/',include(tagging_router.urls)),]Creategeneric_taggingdatabase tables by running:$ python manage.py migrateHow to add tagging feature to your modelAll you have to do is embed the two template tags into your models’ templates.Add{% load tagging %}to load tagging modulePlace{% render_generic_tagging_head_tag %}into<HEAD>tagPlace{% render_generic_tagging_component_tag_for object %}to where you like.{% load tagging %}<!DOCTYPE html><htmllang="en"><head><scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>{% render_generic_tagging_head_tag %}
    ...</head><body><h1>{{ object.title }}</h1>{% render_generic_tagging_component_tag_for object %}</body></html>ViewsThis library has two default views.DescriptionTemplate pathReversed URL nameTag list/templates/generic_tagging/tag_list.htmlgeneric_tagging_tag_listTag detail/templates/generic_tagging/tag_detail.htmlgeneric_tagging_tag_detailTag listThis view displays all tags.templates/generic_tagging/tag_list.htmlshould be used as the template.<h1>All available tags</h1><ul>{% for tag in object_list %}<li><ahref="{{ tag.get_absolute_url %}">{{ tag.label }}</a></li>{% endfor %}</ul>Tag detailEach tags have permalinks to display all related objects.templates/generic_tagging/tag_detail.htmlshould be used as the template.<h1>All contents relative with {{ object.label }}</h1><ul>{% for item in object.items.all %}<li><ahref="{{ item.content_object.get_absolute_url %}">{{ item.content_object }}</a></li>{% endfor %}</ul>APIdjango-generic-tagginghas REST-ful APIs.List of API endpoints.EndpointMethodReversed URL name/tag/GETtag-list/tagged_item/GETtagged_item-list/tagged_item/<pk>/GETtagged_item-detail/tagged_item/CREATEtagged_item-list/tagged_item/<pk>/DELETEtagged_item-detail/tagged_item/<pk>/lock/PATCHtagged_item-lock/tagged_item/<pk>/unlock/PATCHtagged_item-unlockLicenseThe MIT License (MIT)Copyright (c) 2016 giginetPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.