Skip to content

Commit 8a7ff45

Browse files
Merge pull request #261 from algolia/fix/ua-django-version
fix(ua): Add django version to UserAgent
2 parents 86ed611 + 12ba550 commit 8a7ff45

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

algoliasearch_django/registration.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .version import VERSION
1111
from algoliasearch.version import VERSION as CLIENT_VERSION
1212
from platform import python_version
13+
from django import get_version as django_version
1314

1415
logger = logging.getLogger(__name__)
1516

@@ -39,8 +40,8 @@ def __init__(self, settings=SETTINGS):
3940
self.__registered_models = {}
4041
self.client = algoliasearch.Client(app_id, api_key)
4142
self.client.set_extra_header('User-Agent',
42-
'Algolia for Python (%s); Python (%s); Algolia for Django (%s)'
43-
% (CLIENT_VERSION, python_version(), VERSION))
43+
'Algolia for Python (%s); Python (%s); Algolia for Django (%s); Django (%s)'
44+
% (CLIENT_VERSION, python_version(), VERSION, django_version))
4445

4546
def is_registered(self, model):
4647
"""Checks whether the given models is registered with Algolia engine"""

0 commit comments

Comments
 (0)