Package: django-threadedcomments
django-threadedcommentsthreadedcommentsis a Django application which allows for the simple creation of a threaded commenting system.
Commenters can reply both to the original item, and reply to other comments as well.The application is built on top ofdjango_comments,
which allows it to be easily extended by other modules.InstallationInstall the package via pip:pip install django-threadedcommentsIt’s preferred to install the module in a virtual environment.ConfigurationAdd the following tosettings.py:INSTALLED_APPS += (
    'threadedcomments',
    'django_comments',
    'django.contrib.sites',
)

COMMENTS_APP = 'threadedcomments'By placing thethreadedcommentsapp above thedjango.contrib.commentsapplication,
the placeholdercomments/list.htmltemplate will already be replaced by a threaded view.Make suredjango_commentsis configured inurls.py:urlpatterns += patterns('',
    url(r'^articles/comments/', include('django_comments.urls')),
)Provide a template that displays the comments for theobject(e.g. article or blog entry):{% load threadedcomments_tags %}

...

<h2>Comments for {{ object.title }}:</h2>

{% render_comment_list for object %}
{% render_comment_form for object %}Template designNaturally, it’s desirable to write your own version ofcomments/list.htmlin your project,
or use one of thecomments/app/list.htmlorcomments/app/model/list.htmloverrides.Make sure to overridecomments/base.htmlas well, so the other views ofdjango_commentsare displayed using your web site design. The other templates ofdjango_commentsare
very plain as well on purpose (for examplecomments/posted.html),
since these pages depend on the custom design of the web site.See the providedexampleapp for a basic configuration,
including a JavaScript-based reply form that moves to the comment the visitor replies to.Template tagsThethreadedcomments_tagslibrary is a drop-in replacement for thecommentslibrary
that is required for the plain comments. The tags are forwards compatible;
they support the same syntax asdjango_commentsprovides,
and they add a few extra parameters.Fetching comment counts:{% get_comment_count for [object] as [varname] %}
{% get_comment_count for [object] as [varname] root_only %}

{% get_comment_count for [app].[model] [id] as [varname] %}
{% get_comment_count for [app].[model] [id] as [varname] root_only %}Fetching the comments list:{% get_comment_list for [object] as [varname] %}
{% get_comment_list for [object] as [varname] flat %}
{% get_comment_list for [object] as [varname] root_only %}Rendering the comments list:{% render_comment_list for [object] %}
{% render_comment_list for [object] root_only %}

{% render_comment_list for [app].[model] [id] %}
{% render_comment_list for [app].[model] [id] root_only %}Fetching the comment form:{% get_comment_form for [object] as [varname] %}
{% get_comment_form for [object] as [varname] with [parent_id] %}
{% get_comment_form for [app].[model] [id] as [varname] %}
{% get_comment_form for [app].[model] [id] as [varname] with [parent_id] %}Rendering the comment form:{% render_comment_form for [object] %}
{% render_comment_form for [object] with [parent_id] %}
{% render_comment_form for [app].[model] [id] %}
{% render_comment_form for [app].[model] [id] with [parent_id] %}Rendering the whole tree:{% for comment in comment_list|fill_tree|annotate_tree %}
    {% ifchanged comment.parent_id %}{% else %}</li>{% endifchanged %}
    {% if not comment.open and not comment.close %}</li>{% endif %}
    {% if comment.open %}<ul>{% endif %}

    <li id="c{{ comment.id }}">
        ...
    {% for close in comment.close %}</li></ul>{% endfor %}
{% endfor %}Thefill_treefilter is required for pagination, it ensures that the parents of the first comment are included as well.Theannotate_treefilter adds theopenandcloseproperties to the comment.Extending the moduleThe application is built on top of the standarddjango_commentsframework,
which supports various signals, and template overrides to customize the comments.To customize django-threadedcomments, override the proper templates, or include the apps that provide the missing features.
Front-end editing support for example, is left out on purpose. It belongs to the domain of moderation, and policies
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.
The same applies to social media logins, comment subscriptions, spam protection and Ajax posting.Note that the standard framework also supports moderation, flagging, and RSS feeds too. More documentation can be found at:Django’s comments frameworkCustomizing the comments frameworkExample of using the in-built comments appSome of the modules worth looking at are:django-comments-spamfighterdjango-myrecaptchadjango-fluent-commentsThese modules can enhance the comments system even further.