CentOS에 장고 응용 프로그램을 배포했습니다.Django Apache mod_wsgi 500
WSGISocketPrefix /var/run/wsgi
<VirtualHost *:80>
WSGIDaemonProcess safe python-path=/usr/lib/python2.6/site-packages
WSGIProcessGroup safe
WSGIScriptAlias//opt/safe/safe/wsgi.py
<Directory /opt/safe/safe/>
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
편집이 : 이것은 내 TEMPLATE_DIRS
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
"/opt/safe/static/templates",
"/var/www/html/static/templates",
)
편집입니다 : 여기처럼 내 httpd.conf 파일이 모습입니다 이건 내 관리/이메일 전송 설정입니다 :에서
ADMINS = (
# ('Your Name', '[email protected]'),
('David', '[email protected]'),
)
SEND_BROKEN_LINK_EMAILS = True
DEFAULT_FROM_EMAIL = '[email protected]'
SERVER_EMAIL = DEFAULT_FROM_EMAIL
내 템플릿 디렉토리에 사용자 정의 500.html
파일을 정의했습니다. 내 settings.py
에 을 설정하면이 사용자 지정 500.html 페이지를 보지 않고도 내 사이트의 어느 곳으로도 이동할 수 없습니다.
로그 파일에 오류가 없다는 사실이 훨씬 이상합니다. 그래서 어디를 보거나 진행할 지 확신 할 수 없습니다. 내 사용자 지정 500.html 파일 때문에 템플릿을 볼 수 있지만 500 내부 서버 오류의 원인을 모르겠습니다.
편집 : 당신은 원인을 naildown 할 파일에 모든 로그인 시도 할 수
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 89, in get_response
response = middleware_method(request)
File "/usr/lib/python2.6/site-packages/django/middleware/common.py", line 55, in process_request
host = request.get_host()
File "/usr/lib/python2.6/site-packages/django/http/__init__.py", line 223, in get_host
"Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): %s" % host)
SuspiciousOperation: Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): [my ip address]
디버그를 true로 설정하면 모든 것이 정상적으로 작동합니까? –
예 - 정상적으로 모든 항목에 액세스 할 수 있습니다 (모든 URL이 작동하며 모든 것). – lightningmanic
template_dirs 튜플의 모양은 무엇입니까? –