-
Notifications
You must be signed in to change notification settings - Fork 0
/
wsgi.py
31 lines (23 loc) · 862 Bytes
/
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
""" Init wsgi application. """
import os.path
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'simple'))
from main.wsgi import application
from django.conf import settings
if settings.DEBUG:
import uwsgi
from uwsgidecorators import timer
from werkzeug.debug import DebuggedApplication
from django.utils import autoreload
from django.views import debug
@timer(3)
def check_code(sig):
""" Check for code is changed. """
if autoreload.code_changed():
uwsgi.reload()
def null_technical_500_response(request, exc_type, exc_value, tb):
""" Populate exceptions to werkzeug. """
raise exc_type, exc_value, tb
debug.technical_500_response = null_technical_500_response
application = DebuggedApplication(application, evalex=True)
# pylama:ignore=F0401,E0611