我的Django项目中有一个奇怪的MemoryError问题.
我有一个模板标签,使用PIL调整图像大小,并在我的开发机器上运行良好,但在生产中它会导致500大错误的大图像(~800px).模板标签似乎没有问题,但只有原始图像已经非常小.模板标签是http://djangosnippets.org/snippets/1944/的修改版本
刚尝试重新编译mod_wsgi for python2.7 - 同样的错误.
有没有办法分配更多的内存,或者还有其他我不理解的东西?
任何帮助将非常感激!
通过电子邮件发送给我的Traceback是:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/var/www/rizzyhome.com/www/django/rizzyhome/products/views.py", line 31, in designs
context_instance=RequestContext(request)
File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py", line 20, in render_to_response
return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 188, in render_to_string
return t.render(context_instance)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 123, in render
return self._render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 117, in _render
return self.nodelist.render(context)
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 744, in …Run Code Online (Sandbox Code Playgroud) django mod-wsgi apache2 out-of-memory python-imaging-library