Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 86c663c

Browse files
committed
Instantiate a default Client in the WSGI middleware
Makes client optional. If left off, initialize the default Client()
1 parent 8bd666d commit 86c663c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

raven/middleware.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ class Sentry(object):
1818
>>> from raven.base import Client
1919
>>> application = Sentry(application, Client())
2020
"""
21-
def __init__(self, application, client):
21+
def __init__(self, application, client=None):
2222
self.application = application
23+
if client is None:
24+
from raven.base import Client
25+
client = Client()
2326
self.client = client
2427

2528
def __call__(self, environ, start_response):

0 commit comments

Comments
 (0)