django-comments-xtd | Django comments app with thread support | Notification library
kandi X-RAY | django-comments-xtd Summary
kandi X-RAY | django-comments-xtd Summary
Django comments app with thread support, follow-up notifications, mail confirmation, like/dislike flags and moderation.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Render the comments
- Returns a tree of comments
- Validate content type and object
- Returns the app model options
- Render a comment
- Returns the templated template
- Mute the comment thread
- Return the comment if it exists
- Render the last Xtd comments
- Returns a list of content types for a given tag
- Reply to a comment
- Return whether the content is allowed for this request
- View function for confirmation
- Returns the last XtdComments for the given tag
- Like a comment
- Displays a comment
- Called when a comment is posted
- Get a XtdCommentCountNodeNode node
- Flag a comment
- Gets a who can post the given template
- Returns a string representation of the object
- Returns a queryset of the selected comments
- Set whether the comment was posted
- Render the comment tree
- Add new XtdComment objects
- Setup the extension
django-comments-xtd Key Features
django-comments-xtd Examples and Code Snippets
Community Discussions
Trending Discussions on django-comments-xtd
QUESTION
I am new to Django and was working on my blog site to include a comment feature by using django-comments-xtd package.
I was following the tutorials specified on "https://django-comments-xtd.readthedocs.io/en/latest/tutorial.html", but it kept giving me an error saying "DoesNotExist at /comments/post/" whenever I tried to submit any comment
This is comment section code from my blog template from DetailView:
...ANSWER
Answered 2021-May-25 at 06:49As stated in the second point in the quickstart guide [django-comments-xtd Docs] of the package you use:
Enable the “sites” framework by adding
'django.contrib.sites'
toINSTALLED_APPS
and definingSITE_ID
. Visit the admin site and be sure that the domain field of theSite
instance points to the correct domain (localhost:8000
when running the default development server), as it will be used to create comment verification URLs, follow-up cancellations, etc.
You need to enable the sites framework, set the SITE_ID
setting and make sure the domain is correctly saved. To do this as referred in Django's documentation (linked in above quote):
Add 'django.contrib.sites' to your INSTALLED_APPS setting.
Define a SITE_ID setting:
QUESTION
I'm setting up comments in Wagtail using django-comments-xtd and one thing I'm having trouble figuring out is why my comment permalinks keep going to https://example.com/news/bloggy-test-post/#c1 instead of https://localhost:8000/news/bloggy-test-post/#c1.
I found a user with a similar issue in the Wagtail Google group who discovered that they had "example.com" set as their site in Wagtail admin. But I have only one site in my settings and it's currently set to "localhost" with a port of 8000.
Screenshot of the Wagtail admin site showing there is one site set to localhost with a port of 8000
I searched all my files and libraries for "example.com" and the only other setting I found was the BASE_URL setting in base.py. I tried changing that to http://localhost:8000 and the comment permalinks are still being directed to "example.com".
Is there another setting I'm missing? Or another way I'm supposed to get the URL?
Currently, I have this code for grabbing the url in my models.py file:
...ANSWER
Answered 2021-May-12 at 01:27Django has its own optional Sites framework which is distinct from Wagtail's concept of sites. In the standard Wagtail project template this is turned off (i.e. django.contrib.sites
is left out of INSTALLED_APPS) but your project may have it enabled, particularly if you integrated Wagtail into an existing Django project. Like Wagtail, Django's site records are kept in the database, and I suspect this is where the example.com
reference is hiding - if you have the Django admin site enabled (as distinct from the Wagtail one), you should find a Sites model listed in there.
Digging into the django-comments-xtd and django-contrib-comments code shows that the URL returned by the {% get_comment_permalink %}
tag is ultimately handled by the django.contrib.contenttypes.views.shortcut
view, which is indeed listed as making use of the Django sites framework.
As for why adding a second Wagtail site circumvents the problem: when Wagtail generates page URLs, it will prefer to return local URLs without the domain (e.g. ) when it can do so unambiguously - as is the case when only one Wagtail site is defined. Once you add a second site, it switches to a full URL including the domain - and at that point, Django recognises that it's been passed a full URL and doesn't try to apply its own site logic to 'fix' it up.
QUESTION
Django==3.0.8
django-comments-xtd==2.6.2
views.py
...ANSWER
Answered 2020-Jul-30 at 09:28In your INSTALLED_APPS,in settings.py, If django.contrib.auth is above your app, DJANGO will render the default auth , So what you should do is place your app above the django.contrib.auth so that DJANGO will render yours first.
That works for me
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install django-comments-xtd
You can use django-comments-xtd like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page