0
得到一個collectstatic error
後,我跑了命令heroku run python ./manage.py collectstatic --noinput
,我得到了這個追蹤:記錄儀 'django_request' 無法配置
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
django.setup()
File "/app/.heroku/python/lib/python2.7/site-packages/django/__init__.py", line 20, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/log.py", line 87, in configure_logging
logging_config_func(logging_settings)
File "/app/.heroku/python/lib/python2.7/logging/config.py", line 794, in dictConfig
dictConfigClass(config).configure()
File "/app/.heroku/python/lib/python2.7/logging/config.py", line 627, in configure
'%r: %s' % (name, e))
ValueError: Unable to configure logger 'django_request': Unable to add handler 'request_handler': 'request_handler'
這是我manage.py
文件:
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_test.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
我Procfile
:
web: gunicorn django_test.wsgi
而的節:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'mail_admins':{
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
'filters': ['require_debug_false'],
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propogate': True,
},
}
}
在Procfile
,我試圖取代.wsgi
與.app
但我只產生ImportError
和我在網上研究了我的錯誤,但我仍然不知道爲什麼,我發現了ValueError
或如何修理它。另外,我想知道是否需要Apache服務器讓我的Django站點能夠工作,否則Gunicorn就足夠了?我會很感激你能給我的任何幫助。謝謝。
它沒有解釋該消息,但感謝您的拼寫更正。 – brown1001 2015-02-24 18:01:35