问题描述
我试图运行 python3.8 manage.py runserver
我在 INSTALLED_APPS 中定义了 request_id,在 setting.py 下的 MIDDLEWARE 中添加了 request_id.middleware.RequestIdMiddleware
这是回溯
> Exception ignored in thread started by: <function
> check_errors.<locals>.wrapper at 0x7fe56c1d78b0> Traceback (most
> recent call last): File
> "/usr/lib/python3/dist-packages/django/utils/autoreload.py",line 228,> in wrapper
> fn(*args,**kwargs) File "/usr/lib/python3/dist-packages/django/core/management/commands/runserver.py",> line 116,in inner_run
> autoreload.raise_last_exception() File "/usr/lib/python3/dist-packages/django/utils/autoreload.py",line 251,> in raise_last_exception
> six.reraise(*_exception) File "/usr/lib/python3/dist-packages/django/utils/six.py",line 685,in
> reraise
> raise value.with_traceback(tb) File "/usr/lib/python3/dist-packages/django/utils/autoreload.py",**kwargs) File "/usr/lib/python3/dist-packages/django/__init__.py",line 22,in setup
> configure_logging(settings.LOGGING_CONfig,settings.LOGGING) File "/usr/lib/python3/dist-packages/django/utils/log.py",line 75,in
> configure_logging
> logging_config_func(logging_settings) File "/usr/lib/python3.8/logging/config.py",line 808,in dictConfig
> dictConfigClass(config).configure() File "/usr/lib/python3.8/logging/config.py",line 553,in configure
> raise ValueError('Unable to configure ' ValueError: Unable to configure filter 'request_id'
我使用 python3.8 运行它,但不确定为什么在回溯中引用了 python3。
更新:从 settings.py 添加相关行
LOGGING = {
"filters": {
"request_id": {
"()": "request_id_django_log.filters.RequestIDFilter"
},},}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)