Search code examples
djangodjango-comments

How to display comments in Django Admin?


I'm using django.contrib.comments for allowing users to comment on a blog. How is it possible to make the comments display on the Django Admin /admin/comments/comment/ and make them clickable for editing?

[Here should be an image, but since this is my first question and I have no credit, it is not allowed to include images]

The comments can be accessed via /admin/comments/comment/comment_id/ and edited without problems.

Any ideas how to get that solved?


Solution

  • Looking at django.contrib.comments.admin, it should be already visible in your admin panel, provided you added 'django.contrib.comments' to INSTALLED_APPS.

    EDIT:

    Second look at admin.py from Comments app revelaed that CommentsAdmin.list_display doesn't contain the comment itself. So I would either inherit from that CommentsAdmin, override list_display and then unregister and re-register Comment with MyNewCommentsAdmin - or I would just monkey-patch CommentsAdmin. Whichever works.