ImportError: Module "django_comments_xtd" does not define a "XtdComment" attribute/class
When I installed django-comments-xtd according the documention I got this error:
ImportError: Module "django_comments_xtd" does not define a "XtdComment" attribute/class
Configs in settings.py are:
INSTALLED_APPS += [
'django_comments_xtd',
'django_comments',
'django.contrib.sites',
]
SITE_ID = 1
COMMENTS_APP = "django_comments_xtd"
COMMENTS_XTD_MODEL = 'django_comments_xtd.XtdComment'
COMMENTS_XTD_MAX_THREAD_LEVEL = 3
COMMENTS_XTD_CONFIRM_EMAIL = False
COMMENTS_XTD_ALLOW_ANONYMOUS = True
COMMENTS_XTD_ALLOW_PUBLICATION_MODERATION = True
I remove COMMENTS_XTD_MODEL = 'django_comments_xtd.XtdComment'
from settings.py and problem solved.
Why does this line cause an error?
The setting COMMENTS_XTD_MODEL
is only needed if you're using a custom comment model.
Since you're not defining a custom comment model, there's no need to set COMMENTS_XTD_MODEL
, and including it with a wrong path will cause an ImportError
.