from django.db import connectionswith connections['my_db_alias'].cursor() as cursor: ...参考连贯:将原始游标用于多个数据库