I
I
iegor2015-10-05 18:32:28
Django
iegor, 2015-10-05 18:32:28

How to solve the problem of identical Disqus comments?

The essence of the problem: the same comments for all posts.
HTML code:

<a class="label label-default push" role="button" data-toggle="collapse" href="#showcomment{{page.id}}"
    data-disqus-identifier="{{ page.id }}" 
    data-disqus-url="http://127.0.0.1:8000/category/{{category_name}}/{{ page.id }}" 
    data-disqus-title="{{ page.title }}" 
    data-disqus-category="{{ category_name }}">
        <div class="glyphicon glyphicon-chevron-down show-comments" aria-hidden="true">
         </div>
</a>
<div class="collapse" id="showcomment{{page.id}}">
                              <div class="well del" id="">
                              </div>
</div>

JS:
$('.push').click(function(){
    $dis = $(this)
    $('.del').removeAttr('id');
    $dis.next('div').children('.del').attr('id', 'disqus_thread');
    var disqus_shortname = 'allfreecourses';
    var disqus_identifier = String($dis.data('disqus-identifier'));
    var disqus_url = $dis.data('disqus-url');
    var disqus_title = $dis.data('disqus-title');
    var disqus_category_id = $dis.data('disqus-category');
    dsq = document.createElement('script');
    dsq.async = true;
    dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
    (document.head||document.body).appendChild(dsq);
})

The posts are on the same page - there is only one real url, but all variables for disqus are unique.
It turns out that all comments are tied to the real url, and identifiers are not taken into account.
With a similar implementation using the disqus api for django, the binding goes to the URL I specified.
Actually what am I doing wrong

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
ukrop12, 2017-05-20
@ukrop12

Maybe not quite on the topic, and it's too late, but suddenly someone will come in handy. I had a similar situation due to the fact that one discussion began to have an address like " http://site/post " (probably as a result of a change in the address of the post, but not exactly). And should have " http://website/post/postname ". I changed it manually through the disqus administration panel in the "community" tab, click on the "moderate comments" bar and there should be a "discussions" item in the menu. It turned out to click on the link next to the name and change it manually. It is worth paying attention if there is a discussion with a title in the spirit of "Post Page". Although this is not the final solution yet, now the discus for each new post creates such a discussion and needs to be corrected manually...3e74833f0eec4549bd98b57c1ab1280c.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question