方式一 utils文件夹下,简历redis_pool.py import redis POOL = redis.ConnectionPool(host='127.0.0.1', port=6379,password='1234',max_connections=1000) views中使用 import redis from django.shortcuts import render,HttpResponse from utils.redis_pool import POOL def inde…