Answer the question
In order to leave comments, you need to log in
Why are the links not working?
Making comments in Django using https://django-comments-xtd
I wrote get_absolute_url (as written in the documentation) so that errors do not occur, but they occur if you click on the preview button, delete, reply to a comment, etc. Only send works. Here is an example of the error:
TemplateDoesNotExist at /comments/reply/5/
models.py:
class Comment(models.Model):
title = models.CharField(max_length=30, default="tit")
def get_absolute_url(self):
return reverse("comment")
path('info', Comment2.as_view(), name='comment'),
class Comment2(TemplateView):
template_name = "registration/comments.html"
def get_context_data(self, **kwargs):
context = super(Comment2, self).get_context_data(**kwargs)
comment = Comment.objects.get(pk=1)
context['comment'] = comment
return context
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question