나는 설정 .DEBUG 변수를 토글하도록보기를 작성했습니다. 내 웹 사이트에서 Django의 DEBUG 기능을 활성화 및 비활성화 할 수 있기를 바랍니다.보기를 통해 django의 동적 디버그 모드를 변경합니다.
from myApp import settings
def toggleDEBUGView(request):
if request.user.is_superuser:
settings.DEBUG = not(settings.DEBUG)
settings.py에서 DEBUG=False
을 설정했습니다. 따라서 DEBUG가 내 사용자 정의보기를 통해 true로 설정된 경우에도 마찬가지입니다. 난 아직도 서버 오류 (500)
이보십시오 duplicate http://stackoverflow.com/questions/6528723/changing-django-settings-at-runtime – MaNKuR