2ik / django-editorjs-fields

Django plugin for using Editor.js
MIT License
133 stars 33 forks source link

'editorjs_image_upload' is not a valid view function or pattern name #33

Closed breisfeld closed 2 years ago

breisfeld commented 2 years ago

Hi, I am a newcomer to Django.

I have installed django-editorjs-fields and added a EditorJsTextField() to a couple of my models. I have not included any plugins.

When trying to add an instance of a model through the admin interface, I am getting the following exception:

Exception Type: NoReverseMatch
Reverse for 'editorjs_image_upload' not found. 'editorjs_image_upload' is not a valid view function or pattern name.

I have included django_editorjs_fields in the INSTALLED_APPS.

I am using django v4.04 and django-editorjs-fields v0.2.6.

Thank you for your help.

2ik commented 2 years ago

https://github.com/2ik/django-editorjs-fields#image-uploads

# urls.py
from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    ...
    path('editorjs/', include('django_editorjs_fields.urls')),
    ...
]
breisfeld commented 2 years ago

Thank you for the advice. Although, I am not interested in enabling image uploads, I did make the changes you recommended. Unfortunately, I still received the same error.

2ik commented 2 years ago

can you upload your project to github? if not, please see an example at the moment I can't say exactly what the error is

breisfeld commented 2 years ago

Thank you for the reply. I found my error: I had neglected to include a {{ form.media }} variable in my html template.

2ik commented 2 years ago

I am very glad that everything worked out for you!