forms.Form widget
robertsmoto opened this issue · 1 comments
robertsmoto commented
forms.py
from django import forms
from django_editorjs_fields import EditorJsWidget
class MyForm(forms.Form):
content = forms.CharField(
widget=EditorJsWidget(
config=None,
plugins=None,
tools=None,
)
)
template.html
<form
action="#"
method="POST"
id="myFormID">
{% csrf_token %}
{{ form.media }}
<div>
{{ form.content }}
</div>
</form>
Everything works as expected, except I get an error 'Uncaught TypeError: Node.appendChild: Argument 1 does not implement interface Node.' and 'Failed to retrieve the requested file: https://cdn.jsdelivr.net/npm/@editorjs/editorjs@2.25.0:8'
The errors only occur when clicking on the 'click to tune' menu on the following tools: heading, quote, table and list.
robertsmoto commented
Use this in settings.py
EDITORJS_VERSION = 'latest'