django-summernote icon indicating copy to clipboard operation
django-summernote copied to clipboard

How can i disable attachments?

Open medeiroslucass opened this issue 4 years ago • 2 comments

How can i disable attachments? i tried to change my configuration in settings.py but i got this error: Reverse for 'django_summernote-upload_attachment' not found. 'django_summernote-upload_attachment' is not a valid view function or pattern name.

my settings.py: SUMMERNOTE_CONFIG = { 'iframe' : True, 'summernote' : { 'airMode': False, 'width' : '100%', 'lang' : 'pt-BR' }, 'disable_attachment': True, }

medeiroslucass avatar Dec 15 '21 14:12 medeiroslucass

Hi,

urls.py of django-summernote 0.8.20.0 doesn't return the url 'django_summernote-upload_attachment' if SUMMERNOTE_CONFIG['disable_attachment'] == True but SummernoteWidgetBase tries to get this url in any case.

As a workaround I added this line to urls.py path('summernote/upload_attachment/', SummernoteUploadAttachment.as_view(), name='django_summernote-upload_attachment'), after this line path('summernote/', include('django_summernote.urls')),

Now this url is always available.

simonasjutkevicius avatar Feb 01 '22 14:02 simonasjutkevicius

Thanks, after updating packages it just started crashing, this fix worked for me. If that's fixed in a future release I will appreciate a lot if someone can let us now in this thread. Take care!

perepicornell avatar Apr 07 '22 14:04 perepicornell