-
Notifications
You must be signed in to change notification settings - Fork 35
/
wsgi.py
36 lines (28 loc) · 1.08 KB
/
wsgi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""WSGI config for ontask project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
from django.conf import settings
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings.production')
application = get_wsgi_application()
if settings.DEBUG:
try:
import django.views.debug
import six
# Wrap werkzeug debugger if DEBUG is on
from werkzeug.debug import DebuggedApplication
def null_technical_500_response(request, exc_type, exc_value, tb):
"""Catching the 500 response."""
del request
six.reraise(exc_type, exc_value, tb)
django.views.debug.technical_500_response = null_technical_500_response
application = DebuggedApplication(
application,
evalex=True,
# Turning off pin security as DEBUG is True
pin_security=False)
except ImportError:
pass