Django + disqus: Comment options below every blog entry

575 views Asked by At

On my site, I am displaying multiple blog entries on one page. I would like to give the users the option to comment below every entry, but django-disqus is giving me a hard time.

In my html template, I am rotating through the blog entry items and want to display the comment option by disqus below:

...
{% load disqus_tags %}
{% disqus_dev %}  
...
{% for entry in blog %}
<div class="span5">
    <p>{{ entry.text }}</p> 
    {% set_disqus_identifier "entry_" entry.id %}
    {% disqus_recent_comments shortname 5 50 0 24 %} 
{% endfor %}    
...

However, Django is complaining with an error that

Exception Type: AttributeError
Exception Value: 'list' object has no attribute 'var'

How can I display a dedicated comment field by Disqus for every blog entry?

1

There are 1 answers

0
neurix On BEST ANSWER

It seems that it is not possible to display multiple comment sections on the same page since disqus is using the url as identifier.

There was a SO post regarding a similar implementation in JS.

I have discarded django-disqus and implemented django-fluent-comments Link to GitHub. It seems to allow this specific requirement.

Simply add to your code:

...
{% load comments %}
...
{% render_comment_list for object %}
...

where object is your blog entry object. That works for me as a solution.