我正在做一個Django的網站,我打字./manage.py shell
到我的Ubuntu命令行後出現此錯誤:我需要一個Apache服務器用於我的Django站點嗎?
/home/deanna/django_test/static/
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/deanna/django-deanna/local/lib/python2.7/site-packages/Django-1.7.4-py2.7.egg/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/home/deanna/django-deanna/local/lib/python2.7/site-packages/Django-1.7.4-py2.7.egg/django/core/management/__init__.py", line 354, in execute
django.setup()
File "/home/deanna/django-deanna/local/lib/python2.7/site-packages/Django-1.7.4-py2.7.egg/django/__init__.py", line 20, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/home/deanna/django-deanna/local/lib/python2.7/site-packages/Django-1.7.4-py2.7.egg/django/utils/log.py", line 87, in configure_logging
logging_config_func(logging_settings)
File "/usr/lib/python2.7/logging/config.py", line 794, in dictConfig
dictConfigClass(config).configure()
File "/usr/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'
在SO和互聯網經過大量的研究,我想知道如果在安裝Apache服務器可以解決這個問題錯誤?我已安裝gunicorn
,但足以運行Django站點?
編輯:這是我的settings.py
Amazon S3的部分:
try:
from local_settings import *
except Exception as e:
print e.message
if not DEBUG:
AWS_STORAGE_BUCKET_NAME = os.environ['AWS_STORAGE_BUCKET_NAME']
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
STATICFILES_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
S3_URL = 'http://%s.s3.amazonaws.com/assets/' % AWS_STORAGE_BUCKET_NAME
STATIC_URL = S3_URL
無論Apache是否是一個好主意來運行您的實際站點,您當然不需要它來運行該shell。 – 2015-02-24 17:00:03
所以你說缺乏Apache服務器不會導致我的錯誤?你需要一個Apache服務器來部署該網站嗎? – brown1001 2015-02-24 17:02:39
對於部署,您應該使用Apache等Web服務器。在開發/測試過程中,內置的網絡服務器就足夠了。這個問題與您在過去24小時內發佈的前三個問題有什麼不同嗎? – 2015-02-24 17:07:41