def patch_db_connections():
global __already_patched<EOL>if not __already_patched:<EOL><INDENT>from django.db import connections<EOL>connections._connections = local(connections._connections)<EOL>__already_patched = True<EOL><DEDENT>
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.