code: def patch_db_connections():
      
  
      global __already_patched
  
      if not __already_patched:
          from django.db import connections
  
          connections._connections = local(connections._connections)
          __already_patched = True
docs: This wraps django.db.connections._connections with a TaskLocal object.
  
      The Django transactions are only thread-safe, using threading.local,
      and don't know about coroutines.