Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing image upload size limit in Django-summernote

I'm using django-summernote. How can I change the file size upload limit? I get the error: "Got an error uploading an image: File size exceeds the limit allowed and cannot be used" when I try to add an image using the summernote widget's toolbar.

I can found it in the source here, but it's as far as I could get:

Thanks!

like image 369
43Tesseracts Avatar asked Feb 01 '26 01:02

43Tesseracts


1 Answers

You can control the image upload limit settings using SUMMERNOTE_CONFIG settings.

You need to add attachment_filesize_limit setting with your desired value to your summernote settings.

SUMMERNOTE_CONFIG = {
    ...
    'attachment_filesize_limit': custom_file_limit, # specify the file size
}
like image 85
Rahul Gupta Avatar answered Feb 02 '26 16:02

Rahul Gupta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!