使用Django-CKeditor和django_comments

问题描述 投票:1回答:1

无法将django-ckeditor与django_comments一起使用。我曾经使用过自己的应用程序,但django_comments应用程序上出现了奇怪的错误。我可以看到并使用编辑器,但第一次显示错误'此字段为必填项。并且当我尝试使用Submit按钮再次发布相同评论时,我可以发布它,但是如果没有CKeditor锁定的页面刷新原因,就不能再次使用编辑器。我使用django_comments + fluent_comments + threaddedcomments全部来自django_comments。所以我应该可以使用它CKeditor。但我收到所有时间形式的错误。

由于我使用fluent_comments。,因此我尝试在fluent_comments / views.py上对其进行调试。

request.POST.copy()==>第一次没有收到评论,并且应用显示错误。第二次捕获并发布它,但正如我所说无法再次使用CKEditor。

我的django_comments形式:

class CommentDetailsForm(CommentSecurityForm):
    """
    Handles the specific details of the comment (name, comment, etc.).
    """
    name = forms.CharField(label=pgettext_lazy("Person name", "Name"), max_length=50)
    email = forms.EmailField(label=_("Email address"))
    url = forms.URLField(label=_("URL"), required=False)
    # Translators: 'Comment' is a noun here.
    comment = forms.CharField(label=_('Comment'), widget=CKEditorWidget(),
                              max_length=COMMENT_MAX_LENGTH)

我添加到我的fluent_comments form.html:

<script type="text/javascript" src="{% static "ckeditor/ckeditor-init.js" %}"></script>
<script type="text'/javascript" src="{% static "ckeditor/ckeditor/ckeditor.js" %}"></script>

First initial comment posting

enter image description here

无评论数据,抛出,错误“此字段必填”,再次发布,已发布评论,ckeditor锁定。我快要疯了

无法将django-ckeditor与django_comments一起使用。我曾经使用过自己的应用程序,但django_comments应用程序上出现了奇怪的错误。我可以看到并使用编辑器,但第一次显示错误'...

python django forms ckeditor wysiwyg
1个回答
0
投票

在Django-CKEditor中遇到相同问题,如果找到解决方案,请也提供解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.