Невозможно имплантировать Comments xtd в мой блог
Привет друзья я пытаюсь внедрить комментарии xtd в мой django блог и получаю следующую ошибку кто нибудь может помочь в решении этой проблемы. Настройки, выполненные в коде, приведены ниже, а также ошибка, которую я получаю, также перечислена ниже.
Ошибка возникает, когда я пытаюсь изучить статью
AttributeError at /postpage/first/
'str' object has no attribute '_meta'
Request Method: GET
Request URL: http://127.0.0.1:8000/postpage/first/
Django Version: 3.1.14
Exception Type: AttributeError
Exception Value:
'str' object has no attribute '_meta'
Exception Location: C:\Users\navee\OneDrive\Desktop\script\VENV\lib\site-packages\django\contrib\contenttypes\models.py, line 27, in _get_opts
Python Executable: C:\Users\navee\OneDrive\Desktop\script\VENV\Scripts\python.exe
Python Version: 3.8.10
Python Path:
['C:\\Users\\navee\\OneDrive\\Desktop\\script\\admin',
'c:\\program files\\python38\\python38.zip',
'c:\\program files\\python38\\DLLs',
'c:\\program files\\python38\\lib',
'c:\\program files\\python38',
'C:\\Users\\navee\\OneDrive\\Desktop\\script\\VENV',
'C:\\Users\\navee\\OneDrive\\Desktop\\script\\VENV\\lib\\site-packages']
Server time: Tue, 05 Jul 2022 06:28:17 +0000
Error during template rendering
In template C:\Users\navee\OneDrive\Desktop\script\admin\firmApp\templates\firmApp\basic.html, error at line 0
'str' object has no attribute '_meta'
1 {% load static %}
2 {% load comments %}
3 <!doctype html>
4 <html lang="en">
5 <head>
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width, initial-scale=1">
8
9 <title >{% block title %} {% endblock %}</title>
10
Настройки сделаны в Article.html
{% get_comment_count for object as comment_count %}
<div class="py-4 text-center">
<a href="{% url 'blog:post-list' %}">Back to the post list</a>
⋅
{{ comment_count }} comment{{ comment_count|pluralize }}
ha{{ comment_count|pluralize:"s,ve" }} been posted.
</div>
{% if comment_count %}
<hr/>
<div class="comments">
{% render_comment_list for object %}
</div>
{% endif %}
{% if object.allow_comments %}
<div class="card card-block mb-5">
<div class="card-body">
<h4 class="card-title text-center pb-3">Post your comment</h4>
{% render_comment_form for object %}
</div>
</div>
{% endif %}
Настройки сделаны в файле Home.html
{% for object in object_list %}
...
{% get_comment_count for object as comment_count %}
<p class="date">Published {{ object.publish }}
{% if comment_count %}
⋅ {{ comment_count }} comment{{ comment_count|pluralize }}
{% endif %}
</p>
...
{% endfor %}