forked from getsentry/sentry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwsgi.py
More file actions
34 lines (26 loc) · 835 Bytes
/
wsgi.py
File metadata and controls
34 lines (26 loc) · 835 Bytes
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
"""
sentry.wsgi
~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import os.path
import sys
# Add the project to the python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
sys.stdout = sys.stderr
# Configure the application (Logan)
from sentry.utils.runner import configure
configure()
# Build the wsgi app
import django.core.handlers.wsgi
from django.conf import settings
from raven.contrib.django.middleware.wsgi import Sentry
if settings.SESSION_FILE_PATH and not os.path.exists(settings.SESSION_FILE_PATH):
try:
os.makedirs(settings.SESSION_FILE_PATH)
except OSError:
pass
# Run WSGI handler for the application
application = Sentry(django.core.handlers.wsgi.WSGIHandler())