pythondjangodjango-commentsthreaded-comments

django-threadedcomments: 'RequestContext' object has no attribute 'META'


I try to use django-threadedcomments But when I add into template {% load threadedcomments_tags %}

I get error on this lines {% render_comment_list for publication %} {% render_comment_form for publication %}

'RequestContext' object has no attribute 'META'

But if I use django_comments with {% load comments %} it's work


Solution

  • First thing - when you use {% load comments %} in your template, it uses django.contrib.comments to render the page. When you use {% load threadedcomments_tags %}, it uses django-threadedcomments library.

    Which version of Django do you use? It seems like django-threadedcomments is not compatible with Django 1.10. If you want to continue using it, you need to make own adjustments in the django-threadedcomments code, due to change in render_to_string method. Here are some more insights into that: https://github.com/HonzaKral/django-threadedcomments/issues/78

    The other solution is to go back to Django 1.9, if you don't mind the version at this point. It works fine.