Django升级后出现错误500

时间:2015-07-28 09:39:36

标签: python django apache

我在Ubuntu 14.04上使用python 2.7.6和使用Django 1.6的网站上安装了Apache2服务器。明天我将Django升级到1.8 sudo easy_install --upgrade django。之后只有第一个网站正在运行。其他网站上升500错误。这是apache日志

[Mon Jul 27 06:25:07.379926 2015] [mpm_event:notice] [pid 22488:tid 140625830381440] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Mon Jul 27 06:25:07.379972 2015] [core:notice] [pid 22488:tid 140625830381440] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 27 11:30:28.661967 2015] [mpm_event:notice] [pid 22488:tid 140625830381440] AH00491: caught SIGTERM, shutting down
[Mon Jul 27 11:30:29.777150 2015] [mpm_event:notice] [pid 14809:tid 140681711728512] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Mon Jul 27 11:30:29.777224 2015] [core:notice] [pid 14809:tid 140681711728512] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jul 27 11:32:19.185498 2015] [mpm_event:notice] [pid 14809:tid 140681711728512] AH00491: caught SIGTERM, shutting down
[Mon Jul 27 11:32:20.263081 2015] [mpm_event:notice] [pid 15251:tid 140212319471488] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Mon Jul 27 11:32:20.263186 2015] [core:notice] [pid 15251:tid 140212319471488] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jul 28 08:02:22.246092 2015] [mpm_event:notice] [pid 15251:tid 140212319471488] AH00491: caught SIGTERM, shutting down
[Tue Jul 28 08:02:23.297084 2015] [mpm_event:notice] [pid 17323:tid 140099360208768] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Tue Jul 28 08:02:23.297185 2015] [core:notice] [pid 17323:tid 140099360208768] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jul 28 08:11:13.768112 2015] [mpm_event:notice] [pid 17323:tid 140099360208768] AH00491: caught SIGTERM, shutting down
[Tue Jul 28 08:11:14.881159 2015] [mpm_event:notice] [pid 17844:tid 140223468337024] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Tue Jul 28 08:11:14.881229 2015] [core:notice] [pid 17844:tid 140223468337024] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jul 28 09:05:13.986042 2015] [mpm_event:notice] [pid 17844:tid 140223468337024] AH00491: caught SIGTERM, shutting down
[Tue Jul 28 09:05:15.076053 2015] [mpm_event:notice] [pid 18544:tid 140727691057024] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Tue Jul 28 09:05:15.076167 2015] [core:notice] [pid 18544:tid 140727691057024] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jul 28 09:57:24.254449 2015] [mpm_event:notice] [pid 18544:tid 140727691057024] AH00491: caught SIGTERM, shutting down
[Tue Jul 28 09:57:25.319182 2015] [mpm_event:notice] [pid 19105:tid 140677893478272] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Tue Jul 28 09:57:25.319282 2015] [core:notice] [pid 19105:tid 140677893478272] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jul 28 09:57:45.336099 2015] [mpm_event:notice] [pid 19105:tid 140677893478272] AH00491: caught SIGTERM, shutting down
[Tue Jul 28 09:57:46.407414 2015] [mpm_event:notice] [pid 19533:tid 139860213520256] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Tue Jul 28 09:57:46.407495 2015] [core:notice] [pid 19533:tid 139860213520256] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jul 28 09:58:30.278006 2015] [mpm_event:notice] [pid 19533:tid 139860213520256] AH00493: SIGUSR1 received.  Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 2a01:4f8:d15:dc0::2. Set the 'ServerName' directive globally to suppress this message
[Tue Jul 28 09:58:30.512300 2015] [mpm_event:notice] [pid 19533:tid 139860213520256] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Tue Jul 28 09:58:30.512326 2015] [core:notice] [pid 19533:tid 139860213520256] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jul 28 09:58:45.286141 2015] [mpm_event:notice] [pid 19533:tid 139860213520256] AH00493: SIGUSR1 received.  Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 2a01:4f8:d15:dc0::2. Set the 'ServerName' directive globally to suppress this message
[Tue Jul 28 09:58:45.392009 2015] [mpm_event:notice] [pid 19533:tid 139860213520256] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Tue Jul 28 09:58:45.392031 2015] [core:notice] [pid 19533:tid 139860213520256] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jul 28 10:02:35.249547 2015] [mpm_event:notice] [pid 19533:tid 139860213520256] AH00491: caught SIGTERM, shutting down
[Tue Jul 28 10:02:36.323445 2015] [mpm_event:notice] [pid 20874:tid 139918807410560] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
[Tue Jul 28 10:02:36.323553 2015] [core:notice] [pid 20874:tid 139918807410560] AH00094: Command line: '/usr/sbin/apache2'

这是项目的wsgi.py文件

import os
import sys
sys.path.append('/var/www/myproject')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

感谢您的建议!

1 个答案:

答案 0 :(得分:0)

我解决了!这真的是Django的错误。 DEBUG在settings.py文件中是True值,但仍然出现500错误。我明白了什么是真正的错误,然后输入python manage.py shell。所以它是The TEMPLATE_DIRS setting must be a tuple. Please fix your settings。谢谢大家!

相关问题