Added middleware to strip html spaces

This commit is contained in:
Roberto Rosario
2011-03-06 02:22:38 -04:00
parent 769690da98
commit e1bff0c25a
2 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
# Aliasing it for the sake of page size.
from django.utils.html import strip_spaces_between_tags as short
class SpacelessMiddleware(object):
def process_response(self, request, response):
if 'text/html' in response['Content-Type']:
response.content = short(response.content)
return response