add chrome frame middleware
This commit is contained in:
parent
495e04c1b5
commit
76439498b8
1 changed files with 4 additions and 1 deletions
|
@ -4,9 +4,12 @@
|
||||||
from shortcuts import HttpErrorJson, render_to_json_response
|
from shortcuts import HttpErrorJson, render_to_json_response
|
||||||
|
|
||||||
class ExceptionMiddleware(object):
|
class ExceptionMiddleware(object):
|
||||||
|
|
||||||
def process_exception(self, request, exception):
|
def process_exception(self, request, exception):
|
||||||
if isinstance(exception, HttpErrorJson):
|
if isinstance(exception, HttpErrorJson):
|
||||||
return render_to_json_response(exception.response)
|
return render_to_json_response(exception.response)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
class ChromeFrameMiddleware(object):
|
||||||
|
def process_response(self, request, response):
|
||||||
|
response['X-UA-Compatible'] = 'chrome=1'
|
||||||
|
return response
|
||||||
|
|
Loading…
Reference in a new issue