1
1
Metadata-Version: 1.0
2
2
Name: django-threadedcomments
4
4
Summary: A simple yet flexible threaded commenting system.
5
Home-page: http://code.google.com/p/django-threadedcomments/
6
Author: Eric Florenzano
7
Author-email: floguy@gmail.com
5
Home-page: https://github.com/HonzaKral/django-threadedcomments
6
Author: Diederik van der Boor
7
Author-email: vdboor@edoburu.nl
10
Keywords: django,pinax,comments
9
Download-URL: https://github.com/HonzaKral/django-threadedcomments/zipball/master
10
Description: django-threadedcomments
11
=======================
13
*threadedcomments* is a Django application which allows for the simple creation of a threaded commenting system.
14
Commenters can reply both to the original item, and reply to other comments as well.
16
The application is (as of 0.9) built on top of django.contrib.comments,
17
which allows it to be easily extended by other modules.
23
Install the package via pip::
25
pip install django-threadedcomments
27
It's preferred to install the module in a virtual environment.
32
Add the following to ``settings.py``::
36
'django.contrib.comments',
39
COMMENTS_APP = 'threadedcomments'
41
By placing the ``threadedcomments`` app above the ``django.contrib.comments`` application,
42
the placeholder ``comments/list.html`` template will already be replaced by a threaded view.
44
Make sure django.contrib.comments_ is configured in ``urls.py``::
46
urlpatterns += patterns('',
47
url(r'^articles/comments/', include('django.contrib.comments.urls')),
50
Provide a template that displays the comments for the ``object`` (e.g. article or blog entry)::
52
{% load threadedcomments_tags %}
56
<h2>Comments for {{ object.title }}:</h2>
58
{% render_comment_list for object %}
59
{% render_comment_form for object %}
65
Naturally, it's desirable to write your own version of ``comments/list.html`` in your project,
66
or use one of the ``comments/app/list.html`` or ``comments/app/model/list.html`` overrides.
68
Make sure to override ``comments/base.html`` as well, so the other views of django.contrib.comments_
69
are displayed using your web site design. The other templates of django.contrib.comments_ are
70
very plain as well on purpose (for example ``comments/posted.html``),
71
since these pages depend on the custom design of the web site.
73
See the provided ``example`` app for a basic configuration,
74
including a JavaScript-based reply form that moves to the comment the visitor replies to.
80
The ``threadedcomments_tags`` library is a drop-in replacement for the ``comments`` library
81
that is required for the plain comments. The tags are forwards compatible;
82
they support the same syntax as django.contrib.comments_ provides,
83
and they add a few extra parameters.
85
Fething comment counts::
87
{% get_comment_count for [object] as [varname] %}
88
{% get_comment_count for [object] as [varname] root_only %}
90
{% get_comment_count for [app].[model] [id] as [varname] %}
91
{% get_comment_count for [app].[model] [id] as [varname] root_only %}
93
Fetching the comments list::
95
{% get_comment_list for [object] as [varname] %}
96
{% get_comment_list for [object] as [varname] flat %}
97
{% get_comment_list for [object] as [varname] root_only %}
99
Rendering the comments list::
101
{% render_comment_list for [object] %}
102
{% render_comment_list for [object] root_only %}
104
{% render_comment_list for [app].[model] [id] %}
105
{% render_comment_list for [app].[model] [id] root_only %}
107
Fetching the comment form::
109
{% get_comment_form for [object] as [varname] %}
110
{% get_comment_form for [object] as [varname] with [parent_id] %}
111
{% get_comment_form for [app].[model] [id] as [varname] %}
112
{% get_comment_form for [app].[model] [id] as [varname] with [parent_id] %}
114
Rendering the comment form::
116
{% render_comment_form for [object] %}
117
{% render_comment_form for [object] with [parent_id] %}
118
{% render_comment_form for [app].[model] [id] %}
119
{% render_comment_form for [app].[model] [id] with [parent_id] %}
121
Rendering the whole tree::
123
{% for comment in comment_list|fill_tree|annotate_tree %}
124
{% ifchanged comment.parent_id %}{% else %}</li>{% endifchanged %}
125
{% if not comment.open and not comment.close %}</li>{% endif %}
126
{% if comment.open %}<ul>{% endif %}
128
<li id="c{{ comment.id }}">
130
{% for close in comment.close %}</li></ul>{% endfor %}
133
The ``fill_tree`` filter is required for pagination, it ensures that the parents of the first comment are included as well.
135
The ``annotate_tree`` filter adds the ``open`` and ``close`` properties to the comment.
141
The application is built on top of the standard django.contrib.comments_ framework,
142
which supports various signals, and template overrides to customize the comments.
144
To customize django-threadedcomments, override the proper templates, or include the apps that provide the missing features.
145
Front-end editing support for example, is left out on purpose. It belongs to the domain of moderation, and policies
146
to know "who can do what". That deserves to be in a separate application, it shouldn't be in this application as it focuses on threading.
147
The same applies to social media logins, comment subscriptions, spam protection and Ajax posting.
149
Note that the standard framework also supports moderation, flagging, and RSS feeds too. More documentation can be found at:
151
* `Django's comments framework <https://docs.djangoproject.com/en/dev/ref/contrib/comments/>`_
152
* `Customizing the comments framework <http://docs.djangoproject.com/en/dev/ref/contrib/comments/custom/>`_
153
* `Example of using the in-built comments app <http://docs.djangoproject.com/en/dev/ref/contrib/comments/example/>`_
155
Some of the modules worth looking at are:
157
* django-comments-spamfighter_
158
* django-myrecaptcha_
159
* django-fluent-comments_
161
These modules can enhance the comments system even further.
164
.. _django.contrib.comments: https://docs.djangoproject.com/en/dev/ref/contrib/comments/
165
.. _django-fluent-comments: https://github.com/edoburu/django-fluent-comments/
166
.. _django-myrecaptcha: https://bitbucket.org/pelletier/django-myrecaptcha/
167
.. _django-comments-spamfighter: https://github.com/bartTC/django-comments-spamfighter/
169
Keywords: django,comments,threading
12
171
Classifier: Development Status :: 4 - Beta
13
172
Classifier: Environment :: Web Environment
173
Classifier: Framework :: Django
14
174
Classifier: Intended Audience :: Developers
15
175
Classifier: License :: OSI Approved :: BSD License
16
176
Classifier: Operating System :: OS Independent
17
177
Classifier: Programming Language :: Python
18
Classifier: Topic :: Utilities
178
Classifier: Programming Language :: Python :: 2.6
179
Classifier: Programming Language :: Python :: 2.7
180
Classifier: Topic :: Internet :: WWW/HTTP
181
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
182
Classifier: Topic :: Software Development :: Libraries :: Python Modules