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.
2👍
There is no default size limit.
You should actually do :
from django.conf import settings
file._size > settings.MAX_UPLOAD_SIZE
- [Django]-Celery raise error while passing my queryset obj as parameter
- [Django]-Send an email from an API endpoint using Django Rest Framework and Angular
Source:stackexchange.com