‘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‘,
‘mid.middleware.M1‘,
‘mid.middleware.M2‘,
]
1:一旦process_request返回,则不再执行下面中间件的process_request,直接执行该返回中间件的process_response,然后顺次往上执行.
2:process_request-->路由匹配-->process_view-->view函数-->process_response
3:一旦process_view返回的话,process_view不再往下执行,view函数也不执行,直接执行process_response
4.一旦view视图中报错了,就会走process_exception函数,若在process_exception一直未处理错误,则最终错误返回显示到浏览器,不友好
而一旦错误被处理(process_exception函数返回),则process_exception不再向上走,直接走process_response