ImageFieldを持つフォームを追加した後、自分のサイトでMemoryErrorが発生します。コードは開発サーバー(OS X 10.7.4)では正常に機能しますが、ステージング環境(CentOS)では失敗します。
同様の問題のように見えるものに対して、ここで提案されているソリューションを使用するのは少し気が進まない:Python ctypes MemoryError in fcgi process fromPILlibrary。それはPython自体を変更します-これは長期的なメンテナンスには悪いようです。
私はこれをデバッグする方法について少し無知です...私の無知を治すのを手伝ってください...
トレースバックは次のとおりです。
Environment:
Request Method: POST
Request URL: http://myschoolzoneapp.eatechinc.com/debug/
Django Version: 1.4
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'accounts',
'announcements',
'api',
'devices',
'events',
'menus',
'organizations',
'djangorestframework',
'registration',
'guardian',
'south',
'profiles')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'ischoolhub_project.middleware.ProcessMiddleware')
Traceback:
File "/tmp/egg-cache/Django-1.4-py2.7.egg/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/home/eatech/django/projects/ischoolhub-staging/ischoolhub_project/views.py" in debug
22. if form.is_valid():
File "/tmp/egg-cache/Django-1.4-py2.7.egg/django/forms/forms.py" in is_valid
124. return self.is_bound and not bool(self.errors)
File "/tmp/egg-cache/Django-1.4-py2.7.egg/django/forms/forms.py" in _get_errors
115. self.full_clean()
File "/tmp/egg-cache/Django-1.4-py2.7.egg/django/forms/forms.py" in full_clean
270. self._clean_fields()
File "/tmp/egg-cache/Django-1.4-py2.7.egg/django/forms/forms.py" in _clean_fields
285. value = field.clean(value, initial)
File "/tmp/egg-cache/Django-1.4-py2.7.egg/django/forms/fields.py" in clean
535. return super(FileField, self).clean(data)
File "/tmp/egg-cache/Django-1.4-py2.7.egg/django/forms/fields.py" in clean
153. value = self.to_python(value)
File "/tmp/egg-cache/Django-1.4-py2.7.egg/django/forms/fields.py" in to_python
560. import Image
File "/tmp/egg-cache/PIL-1.1.7-py2.7-linux-i686.egg/Image.py" in <module>
45. __import__("FixTk")
File "/usr/local/lib/python2.7/lib-tk/FixTk.py" in <module>
15. import ctypes
File "/usr/local/lib/python2.7/ctypes/__init__.py" in <module>
555. _reset_cache()
File "/usr/local/lib/python2.7/ctypes/__init__.py" in _reset_cache
279. CFUNCTYPE(c_int)(lambda: None)
Exception Type: MemoryError at /debug/
Exception Value: