Django 生产中出现错误 500,看不到错误



我正在使用Django和WSGI。
当我使用 DEBUG = 真或假运行命令运行服务器时,一切都很好,但是当我创建守护程序来运行我的应用程序时,我得到了带有 500 错误的页面,在 apache 的日志中我得到了错误 500,但即使 DEBUG 为 True,我也看不到错误,我认为这是 apache(2.4.41( 和 wsgi
的问题 这是创建守护程序的配置文件

Alias /static /home/(user)/(domain)/static
<ifmodule mod_wsgi.c>
WSGIDaemonProcess ic user=(user) group=(user) processes=1 threads=2 python-path=/home/(user)/(domain):/home/(user)/.venv/ic
</ifmodule>
WSGIProcessGroup ic
WSGIApplicationGroup ic
WSGIScriptAlias / /home/(user)/(domain)/ic/wsgi.py
WSGIPassAuthorization on
<Directory /home/(user)/(domain)/ic/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
LogLevel debug
Errorlog /var/log/apache2/domlogs/(domain)_error
CustomLog /var/log/apache2/domlogs/(domain)_custom combined

在错误日志中显示这一点(已创建 venv(

[Sat Jan 11 10:24:54.138254 2020] [ssl:debug] [pid 9308:tid 47752169862912] ssl_util_stapling.c(874): AH01956: stapling_cb: setting response
[Sat Jan 11 10:24:54.316201 2020] [ssl:debug] [pid 9308:tid 47752169862912] ssl_engine_kernel.c(383): [client xxx.xxx.xxx.xxx:23440] AH02034: Initial (No.1) HTTPS request received for child 0 (server (url):443)
[Sat Jan 11 10:24:54.316509 2020] [authz_core:debug] [pid 9308:tid 47752169862912] mod_authz_core.c(820): [client xxx.xxx.xxx.xxx:23440] AH01626: authorization result of Require all granted: granted
[Sat Jan 11 10:24:54.316520 2020] [authz_core:debug] [pid 9308:tid 47752169862912] mod_authz_core.c(820): [client xxx.xxx.xxx.xxx:23440] AH01626: authorization result of <RequireAny>: granted
[Sat Jan 11 10:24:54.317397 2020] [authz_core:debug] [pid 9308:tid 47752169862912] mod_authz_core.c(820): [client xxx.xxx.xxx.xxx:23440] AH01626: authorization result of Require all granted: granted
[Sat Jan 11 10:24:54.317408 2020] [authz_core:debug] [pid 9308:tid 47752169862912] mod_authz_core.c(820): [client xxx.xxx.xxx.xxx:23440] AH01626: authorization result of <RequireAny>: granted
[Sat Jan 11 10:24:54.328015 2020] [wsgi:info] [pid 9302:tid 47752171964160] mod_wsgi (pid=9302): Create interpreter 'ic'.
[Sat Jan 11 10:24:54.341454 2020] [wsgi:info] [pid 9302:tid 47752171964160] mod_wsgi (pid=9302): Adding '/home/(user)/(domain)' to path.
[Sat Jan 11 10:24:54.341632 2020] [wsgi:info] [pid 9302:tid 47752171964160] mod_wsgi (pid=9302): Adding '/home/(user)/.venv/ic' to path.

wsgi.py 文件

import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ic.settings')
application = get_wsgi_application()

"帮帮我,堆栈溢出。你是我唯一的希望。

最后我正在观看另一个错误日志,我的问题出在虚拟环境中

最新更新