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