我在Apache 2.4的生产模式下在虚拟环境中使用Django 2.0.1。 每当我尝试从Django的管理面板上传图像时,我都会收到服务器错误500。 具体错误是
[Sat Feb 10 11:37:42.473376 2018] [mpm_event:notice] [pid 1311:tid 140525266585472] AH00491: caught SIGTERM, shutting down
Exception ignored in: <object repr() failed>
Traceback (most recent call last):
File "/var/www/springspree/server/venv/lib/python3.5/site-packages/PIL/Image.py", line 587, in __del__
NameError: name 'hasattr' is not defined
Exception ignored in: <object repr() failed>
Traceback (most recent call last):
File "/var/www/springspree/server/venv/lib/python3.5/site-packages/PIL/Image.py", line 587, in __del__
NameError: name 'hasattr' is not defined
虚拟主机文件是
<VirtualHost *:8000>
ServerAdmin webdev@springspree.in
ServerName www.springspree.in:8000
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /static /var/www/springspree/server/static
<Directory /var/www/springspree/server/static>
Require all granted
</Directory>
Alias /media /var/www/springspree/server/media
<Directory /var/www/springspree/server/media>
Require all granted
</Directory>
<Directory /var/www/springspree/server/springspree>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess django-server python-path=/var/www/springspree/server python-home=/var/www/springspree/server/venv
WSGIProcessGroup django-server
WSGIScriptAlias / /var/www/springspree/server/springspree/wsgi.py
</VirtualHost>
这些文件位于/ var / www目录中,由root拥有。我尝试卸载并安装Pillow但没用。