Django中的常用模块导入
from django.shortcuts import render,redirect # 模板渲染
from django.urls import reverse # url反向解析
from django.http import JsonResponse,HttpResponse # 返回response对象
from django.views.generic import View # 类视图
from django.db import transaction # 数据库相关,如开启事务
from django.conf import settings # django的配置文件
from django.contrib.auth import authenticate, login, logout # auth验证
from django.core.paginator import Paginator # 分页
from django.core.cache import cache # 缓存
from django.contrib import admin # 管理员后台页面,自定义模型管理器类
from django.contrib.auth.decorators import login_required # 登录验证装饰器
from django_redis import get_redis_connection # 操作redis