安装版本
Apache
Python
姜戈
Apache http.conf
Listen 3600
WSGISocketPrefix /var/run/wsgi
<VirtualHost *:3600>
WSGIDaemonProcess project_name display-name=project_name
WSGIScriptAlias / /data/project_name/config/wsgi.py process-group=api application-group=api
ServerName project_name
<Directory /data/project_name/config>
Order allow,deny
Allow from all
Require all granted
<Files wsgi.py>
Require all granted
</Files>
</Directory>
</VirtualHost>
错误日志Exception ignored in: <function Local.__del__ at 0x7fd675a70a60>
Traceback (most recent call last):
File "/data/venv/api/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__
NameError: name 'TypeError' is not defined
上面的错误日志一遍遍的出来。不知道为什么不使用asgi时会出现asgi相关的错误。
最佳答案
我在我的日志中看到了相同的类似内容,只有在 apache 关闭(并因此重新启动)期间。正如@GrahamDumpleton 几年前在一个类似风格的问题(有不同的错误)中所回答的那样,在关闭 python 解释器时,后台线程可能仍在运行。见 NameError: name 'hasattr' is not defined - Python3.6, Django1.11, Ubuntu16-17, Apache2.4, mod_wsgi
关于apache - Apache 中的 `NameError: name ' 类型错误 ' is not defined`(mod_wsgi),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64674403/