Skip to content
This repository was archived by the owner on Jun 11, 2018. It is now read-only.

Commit 44eabfe

Browse files
committed
django: get_client_class: use CLIENT setting
This makes the management command (`manage.py opbeat test`) use any custom client.
1 parent 9c8cf2f commit 44eabfe

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

opbeat/contrib/django/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ class ProxyClient(object):
110110
default_client_class = 'opbeat.contrib.django.DjangoClient'
111111

112112

113-
def get_client_class(client_path=default_client_class):
113+
def get_client_class(client_path=None):
114+
if client_path is None:
115+
config = getattr(django_settings, 'OPBEAT', {})
116+
client_path = config.get('CLIENT', default_client_class)
114117
module, class_name = client_path.rsplit('.', 1)
115118
return getattr(__import__(module, {}, {}, class_name), class_name)
116119

0 commit comments

Comments
 (0)