'comments-post-comment' is not a valid view function or pattern name.
HelloGit100 opened this issue · 4 comments
-
I follow the tutorial in https://django-contrib-comments.readthedocs.io/en/latest/quickstart.html.
-
I added some comments to the article in the background (http://127.0.0.1/admin/django_comments/comment/.).
-
Get the comment content with the following code:
{% get_comment_list for article as comment_list %} {% for comment in comment_list %} <div class="content"> <a name="c{{ comment.id }}">{{ comment.comment }}</a> </div> {% endfor %}
- When I added the following code:
{% render_comment_form for article %}
The following error has occurred:
NoReverseMatch at /article/1/ Reverse for 'comments-post-comment' not found. 'comments-post-comment' is not a valid view function or pattern name. Request Method: GET Request URL: http://127.0.0.1/article/1/ Django Version: 2.2 Exception Type: NoReverseMatch Exception Value: Reverse for 'comments-post-comment' not found. 'comments-post-comment' is not a valid view function or pattern name. Exception Location: /home/venv/lib/python3.7/site-packages/django/urls/resolvers.py in _reverse_with_prefix, line 660 Python Executable: /home/venv/bin/python3 Python Version: 3.7.3
Do I need to add something to the application's forms.py?
Looks like django_comments
urls are not properly included in your project. However, this issue tracker is not meant as a support channel but only to report bugs or proposal for the package.
I'm having the same issue, after following the exact steps of the tutorial.
Look at https://github.com/django/django-contrib-comments/blob/master/django_comments/urls.py
That is the file that defines the 'comments-post-comment'
url name. This file is supposed to be included in your project's urls definition by step 5 of the tutorial.
If you are convinced that there is a problem with either the library or its documentation, please supply your settings and your project's main urls.py
.
Look at https://github.com/django/django-contrib-comments/blob/master/django_comments/urls.py
That is the file that defines the'comments-post-comment'
url name. This file is supposed to be included in your project's urls definition by step 5 of the tutorial.If you are convinced that there is a problem with either the library or its documentation, please supply your settings and your project's main
urls.py
.
Hi shaib,
Thanks for your kind reply!
I apologize for leaving a thoughtless comment like this. It was a mistake at my end and I have resolved it.