Passenger WSGI according to their wiki instructions을 사용하여 Dreamhost에서 호스팅되는 장고 프로젝트를 설정하고 mod_wsgi가 나타나고 충돌하는 내부 오류 문제가 발생했습니다.파이썬 붙여 넣기에서 오류 추적을 표시하지 않습니다
following their instructions으로 파이썬 붙여 넣기를 설치하면 웹 페이지에 포괄적 인 로그가 표시되지만 작동하지 않습니다. IE : 내부 오류가있을 때마다 브라우저의 다른 정보없이 django의 "내부 오류"페이지가 표시됩니다.
"def testapplication"앞에 "test"를 제거하여 붙여 넣기 설치를 테스트했을 때 정상적으로 작동했습니다. 하지만 내부 오류가 발생할 때마다 여전히 오류 정보가 포함 된 붙여 넣기 결과를 얻지 못합니다. 대신 정보가없는 동일한 숨겨진 내부 오류 페이지가 표시됩니다.
내 passenger_wsgi.py 파일 :
import os, sys
import django.core.handlers.wsgi
INTERP = os.path.join(os.environ['HOME'], 'env', 'bin', 'python')
if sys.executable != INTERP:
os.execl(INTERP, INTERP, *sys.argv)
os.environ['DJANGO_SETTINGS_MODULE'] = "abc.settings"
sys.path.append(os.getcwd())
sys.path.append(os.path.join(os.getcwd(), 'abc'))
log = file('/home/abcadmin/passengerwsgi.log', 'a')
print >>log, "Running %s" % (sys.executable)
application = django.core.handlers.wsgi.WSGIHandler()
from paste.exceptions.errormiddleware import ErrorMiddleware
sys.stdout = sys.stderr
# remove the "test" below to test paste
def testapplication(environ, start_response):
status = '200 OK'
output = 'Hello World! Running Python version ' + sys.version + '\n\n'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
# to test paste's error catching prowess, uncomment the following line
# while this function is the "application"
raise("error")
start_response(status, response_headers)
return [output]
application = ErrorMiddleware(application, debug=True)
내 웹 서버 오류 로그 (하는 error.log)이 비어 있고 내 액세스 로그 (액세스
는 위키에 따르면, 내 구성이 올바른지 .log)는 다음과 같은 메시지로 가득 차 있습니다 (최신 행 - 가짜 링크로 편집 됨). access.log가 뭔가를 로깅하고 있기 때문에 어딘가에서 로깅이 발생하지만 그 오류는 "내부 오류"페이지를 제외하고 어디에도 나타나지 않습니다.
46.246.117.3 - - [21/Feb/2012:00:27:04 -0800] "GET /admin/ HTTP/1.1" 200 2326 "http://abc.acme.com/admin/userProfile/profile/16/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20100101 Firefox/10.0.2"
장고 프로젝트
내 dev에 환경에서 잘 실행되지만, 서버에서 승객 WSGI를 실행중인 경우 발생하는 서버 문제의 어떤 종류가있다 - 나는 시도 붙여 넣기 및 디버그 이러한 오류를 설치했습니다. 내 설치가 Django가 아닌 다른 종류의 오류로 실행될 때 나는 그 "숨겨진"내부 오류 메시지를 받는다.
** 웹 서버 오류 로그 **의 내용은 무엇입니까? –
방금 질문과 대답을 편집했습니다. 위를 참조하십시오. – serpah