# Building a powerful comment system

DevFeed: [Building a powerful comment system](<https://devfeed.tech/articles/building-a-powerful-comment-system-19994.md>)

Original publisher: [Read original article](<http://engineering.hackerearth.com/2015/01/27/making-comments-more-powerful/>)

Published: 2015-01-27T00:00:00Z

Content type: article

Language: en

Sources: [HackerEarth](<https://devfeed.tech/sources/hackerearth.md>)

Topics: [Django](<https://devfeed.tech/topics/django.md>), [App](<https://devfeed.tech/topics/app.md>), [Code](<https://devfeed.tech/topics/code.md>), [User experience (UX)](<https://devfeed.tech/topics/ux.md>), [Ajax](<https://devfeed.tech/topics/ajax.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>)

Tags: [app](<https://devfeed.tech/tags/app.md>), [code](<https://devfeed.tech/tags/code.md>), [django](<https://devfeed.tech/tags/django.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [ux](<https://devfeed.tech/tags/ux.md>)

## AI overview

The article describes how a team built a more powerful and usable threaded comment system for its website using the open-source django-threadedcomments Django app. It explains the system's pluggable architecture, reusable template integration, customizable comment rendering, AJAX-based operations, and breadth-first traversal for handling deletion in threaded comment trees.

## Source excerpt

In this post, I am going to briefly descibe the challenges we faced while building a powerful comment system. Comments have become an integral part of our website. They are integrated almost everywhere - challenges, problems, notes etc. and soon will be added to our new products. We have been working to make it more powerful and usable. Here is what we did: Pluggable architecture Ajaxifying comments Realtime sync Tagging people From the beginning Our comment system is built using an open source django app, named django-threadedcomments. In threadedcomments, commenters can reply both to the original item, and reply to other comments as well. This open source app best suited our requirements in terms of UX, hence we decided to use it. But later we realised it was not powerful enough, and we decided to add our own features in it. Pluggable architecture Our commmenting system is a plug and play app. We added a layer on top of django-threadedcommnets which lets us integrate comments anywhere on our website easily without writing the same code again. Below is the snippet which we can include in any django template to add comments. <div id="comments-{{model.get_content_type.id}}-{{model.id}}" class="pagelet-inview standard-margin comments" ajax="{% url render_comments model.id model.get_content_type.id %}" target="comments-{{model.get_content_type.id}}-{{model.id}}"></div> Above single line of code renders complete comment list(including reply form) using bigpipe. Isn't it cool? One more reason I am calling our comment system plug and play is that we can easily override most of the comments display logic, show comments differently on different pages. For example, comments appearing on a note and problem page needs to be shown differently based on the logic 'who is the moderator of the content'. This couldn't have been possible without django template block tag. comments/base/list.html <!-- This blocks handles logic to determine if user is a normal user or a moderator --> {