标签:return not turn 中间 asa one war 功能 bsp
1,首先要写上中间件的原始类.
class MiddlewareMixin(object): def __init__(self, get_response=None): self.get_response = get_response super(MiddlewareMixin, self).__init__() def __call__(self, request): response = None if hasattr(self, ‘process_request‘): response = self.process_request(request) if not response: response = self.get_response(request) if hasattr(self, ‘process_response‘): response = self.process_response(request, response) return response
2,继承原始类,增加自己所需要的功能
例如:让有session的对象可以跳过登录功能
标签:return not turn 中间 asa one war 功能 bsp
原文地址:http://www.cnblogs.com/52forjie/p/7859818.html