File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11import contextlib
2+ from importlib import metadata
23
34from django .core .exceptions import ImproperlyConfigured
45from django .db .backends .base .base import BaseDatabaseWrapper
56from pymongo .collection import Collection
7+ from pymongo .driver_info import DriverInfo
68from pymongo .mongo_client import MongoClient
79
810from . import dbapi as Database
@@ -170,7 +172,10 @@ def get_connection_params(self):
170172 }
171173
172174 def get_new_connection (self , conn_params ):
173- return MongoClient (** conn_params )
175+ return MongoClient (** conn_params , driver = self ._driver_info ())
176+
177+ def _driver_info (self ):
178+ return DriverInfo ("django-mongodb" , metadata .version ("django-mongodb" ))
174179
175180 def _commit (self ):
176181 pass
You can’t perform that action at this time.
0 commit comments