我已经构建了一个博客类型的应用程序 在django.我正在尝试使用montylounge的django-disqus整合DISQUS以征求意见.但所有博客帖子的评论都出现在每个博客页面上.可能是什么问题呢 ?
我正在创建一个"Q&A"网站.在问题页面上可以看到它的所有答案(带分页).我还需要从其他页面直接回答(在页面中).我已经尝试实现命名锚点但无法直接到页面部分.
答案的get_absolute_url()以下列形式返回url:
www.example.com/question-id/question-slug?page=no#aID <!-- EDITED -->
Run Code Online (Sandbox Code Playgroud)
一个示例网址:
www.example.com/question-10/what-is-this?page=2#a20 <!-- EDITED -->
Run Code Online (Sandbox Code Playgroud)
并在HTML中:
{% autopaginate answers 10 %}
{% for answer in answers %}
<div>
<a name="a{{answer.id}}">Answer</a> <!-- EDITED -->
{# answer body goes here#}
</div>
{% endfor %}
{% paginate %}
Run Code Online (Sandbox Code Playgroud)
它会重定向到正确的页面,但不会重定向到正确的页面部分.
编辑:Result! When clicked, After going to the page section, it bounces to the bottom of the page