Questions tagged [django-comments]

Django used to include a simple comments framework. Since Django 1.6, it's been separated to a separate project, use this tag for both. This framework can be used to attach comments to any model, so you can use it for comments on blog entries, photos, book chapters, or anything else.

Django used to include a simple, yet customizable comments framework. Since Django 1.6, it's been separated to a separate project, use this tag for both.

Comments are all "attached" to some parent object. This can be any instance of a Django model.

The primary interaction with the comment system is through a series of template tags that let you embed comments and generate forms for your users to post them.

Reference:

204 questions
1
vote
1 answer

django: customising multiple comments forms/models

In this scenario, I have 2 or more models: class Store(models.Model): name = models.CharField(max_length = 100) homepage = models.URLField(verify_exists = False) .... class Product(models.Model): display =…
twig
  • 4,034
  • 5
  • 37
  • 47
1
vote
1 answer

Django: cant relate my comment to a specific product

I dont know how to link comments to specific product(object). Maybe there is something to do with slugs. P.S. All the comments can be successfully uploaded to the database, but the problem is only with linking them with one product views.py class…
Shaxriyor
  • 11
  • 3
1
vote
1 answer

AttributeError: 'Doctor' object has no attribute 'comments'

I'm working on this project but I got the following error comm = doctor_detail.comments.filter(active=True) AttributeError: 'Doctor' object has no attribute 'comments' however I think that everything is alright this is my models.py class…
1
vote
0 answers

The comment form is displayed incorrectly



I am making comments on django on this video https://www.youtube.com/watch?v=bmFkND-scpY when the author in the middle of the video showed what he had done, he showed this (this is how it should be) enter image description here but for some reason…
1
vote
1 answer

Django load more comments with AJAX

In the profile page, I want to display posts of a user. Each post might have several comments, I don't want to display all the comments to the post instead I want to display only few comments and add load more comments option. If a user clicks load…
sreekanthkura7
  • 115
  • 2
  • 18
1
vote
1 answer

filter objects by number of comments in Django

How do I filter queryset by the number of comments, and order by number of comments descending? I tried to do something like Post.objects.filter(comment_count > 0).order_by('-comment_count') but that didn't work or course. Thanks! My Post…
rabbid
  • 5,465
  • 7
  • 26
  • 37
1
vote
1 answer

Errors using built-in comment framework

I'm trying to use the built-in comment framework but I cannot get it to work. Here's the code: #view.py from django.contrib.comments.forms import * from forms import * from models import * def view_item_detail(request, item_id): item =…
Sgt.Fault
  • 45
  • 1
  • 6
1
vote
2 answers

Django: How to define "Next" within the Comments form

I am using the Django comments framework in two places on my site. After each submission, I'd like for the user to just be redirected back to the original page they were on. How do you define the "next" variable so the user is…
Emile
  • 3,464
  • 8
  • 46
  • 77
1
vote
0 answers

NoReverseMatch at /post/

I want to create a comment part. I did but there is an error in my detail page. The error is *NoReverseMatch at /post/123/ Reverse for 'blog_comment' with arguments '('',)' not found. 1 pattern(s) tried: ['post/(?P\d+)/comment/$']* Here is my…
Jode
  • 111
  • 2
  • 12
1
vote
1 answer

Can't render django-comment form

Can someone see what I am doing wrong here? What am I missing? # works {% get_comment_count for app.somemodel object_pk as comment_count %} {% get_comment_count for model as comment_count %} # Throws error: "Caught AttributeError while rendering:…
Asdf
  • 864
  • 9
  • 13
1
vote
1 answer

Django comments custom user profile avatar

I'm using Ajax Comments System to render comments and the form and I have a custom user profile that include avatar field class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, default="") avatar =…
a7me3D
  • 49
  • 7
1
vote
3 answers

how can i display comments below the respective post in the home page

i want to implement something like fb does like displaying all the respective comments below their respective posts in home page model.py from django.db import models from django.contrib.auth.models import User class Post(models.Model): post =…
1
vote
0 answers

How to use two different comment apps?

For example I want to use my custom comment app (with ranking features, threading, etc) in some pages and in other pages I want to use standard django comment app. How can i do this? thanks
errx
  • 1,761
  • 4
  • 18
  • 25
1
vote
3 answers

Threadedcomments - csrf token and user_name

I am using django-threadedcomments. Everything works fine except 2 things: csrf token and user template tag. Problem is, when user submits a comment, there is no csrf token for the form, so the form could not be validated server-side. Tried adding…
Ruslan
  • 1,208
  • 3
  • 17
  • 28
1
vote
0 answers

Attribute error '/posts/' 'Comment' object has no attribute '_mptt_meta'

I am following this example on how to set threaded comments with django_comments and django-mptt. I have followed most of it and the posted comments are working in admin but I am getting this error 'Comment' object has no attribute '_mptt_meta'. I…
jsonknightlee
  • 173
  • 1
  • 12