I've written a view to toggle the setting.DEBUG variable. hoping to enable and disable DEBUG feature of Django for my website.
from myApp import settings
def toggleDEBUGView(request):
if request.user.is_superuser:
settings.DEBUG = not(settings.DEBUG)
I've set DEBUG=False
in settings.py. So even if the DEBUG is set to true via my custom view. I still get Server Error (500)