[Django]-Is there a default file upload size limit in django?

3👍

There is actually a setting for this:

https://docs.djangoproject.com/en/3.0/ref/settings/#std:string-FILE_UPLOAD_MAX_MEMORY_SIZE

You should add (FILE_UPLOAD_MAX_MEMORY_SIZE) to your settings.py. The default value is 2.5MB.

👤django

2👍

There is no default size limit.

You should actually do :

from django.conf import settings

file._size > settings.MAX_UPLOAD_SIZE

Leave a comment