自定义 django-comments-xtd 时导入错误

Import error while customizing django-comments-xtd

参考 django-XtdComments 的文档,以便使用我的自定义评论模型而不是 XtdComment,设置文件应该是这样的:

COMMENTS_APP = "django_comments_xtd"

COMMENTS_XTD_MODEL = 'commenting.models.BookComment'

此时我有一个评论应用程序和一个用于评论模型的 BookComment 模型,但是设置文件给我导入错误,模块“commenting.models”没有定义“BookComment”attribute/class 谁能帮我看看这段代码有什么问题吗?

我收到此错误的原因是 models.py 中的循环导入 它通过删除无用的导入解决