标签:
在settings.py中注释掉‘django.middleware.csrf.CsrfViewMiddleware‘,如下:
MIDDLEWARE_CLASSES = [
‘django.middleware.security.SecurityMiddleware‘,
‘django.contrib.sessions.middleware.SessionMiddleware‘,
‘django.middleware.common.CommonMiddleware‘,
#‘django.middleware.csrf.CsrfViewMiddleware‘,
‘django.contrib.auth.middleware.AuthenticationMiddleware‘,
‘django.contrib.auth.middleware.SessionAuthenticationMiddleware‘,
‘django.contrib.messages.middleware.MessageMiddleware‘,
‘django.middleware.clickjacking.XFrameOptionsMiddleware‘,
]
class Mymiddleware(object): def process_request(self, request): pass def process_response(self, request, response): pass
标签:
原文地址:http://www.cnblogs.com/leeronggui/p/5393813.html