中间件
from django.middleware.csrf import CsrfViewMiddleware #中间间的本质就是类
MIDDLEWARE = [
‘md.middleware.M1’, #导入md文件夹middleware.py下的M1类
‘django.middleware.security.SecurityMiddleware’,
‘django.contrib.sessions.middleware.SessionMiddleware’,
‘django.middleware.common.CommonMiddleware’,
‘django.middleware.csrf.CsrfViewMiddleware’,
‘django.contrib.auth.middleware.AuthenticationMiddleware’,
‘django.contrib.messages.middleware.MessageMiddleware’,
‘django.middleware.clickjacking.XFrameOptionsMiddleware’,
]