In a JS plugin, my Django view accepts an AJAX POST
of a base64
encoded image. The problem is that the images are too large. I'm getting the following error.
django_1 | Traceback (most recent call last):
django_1 | File "/usr/local/lib/python3.6/site-packages/raven/transport/threaded.py", line 165, in send_sync
django_1 | super(ThreadedHTTPTransport, self).send(url, data, headers)
django_1 | File "/usr/local/lib/python3.6/site-packages/raven/transport/http.py", line 43, in send
django_1 | ca_certs=self.ca_certs,
django_1 | File "/usr/local/lib/python3.6/site-packages/raven/utils/http.py", line 66, in urlopen
django_1 | return opener.open(url, data, timeout)
django_1 | File "/usr/local/lib/python3.6/urllib/request.py", line 532, in open
django_1 | response = meth(req, response)
django_1 | File "/usr/local/lib/python3.6/urllib/request.py", line 642, in http_response
django_1 | 'http', request, response, code, msg, hdrs)
django_1 | File "/usr/local/lib/python3.6/urllib/request.py", line 570, in error
django_1 | return self._call_chain(*args)
django_1 | File "/usr/local/lib/python3.6/urllib/request.py", line 504, in _call_chain
django_1 | result = func(*args)
django_1 | File "/usr/local/lib/python3.6/urllib/request.py", line 650, in http_error_default
django_1 | raise HTTPError(req.full_url, code, msg, hdrs, fp)
django_1 | urllib.error.HTTPError: HTTP Error 413: Request Entity Too Large
Any ideas on how to resolve this? I have found solutions with nginx
, however I am using gunicorn
within cookiecutter-django
project.
Figured it out. Django's defaults are too low for 100mb+ images.
Had to change my settings for
DATA_UPLOAD_MAX_MEMORY_SIZE = XXXX
FILE_UPLOAD_MAX_MEMORY_SIZE = XXXX