old_contents: from misc.utils import custom_spaceless
  
  class SpacelessMiddleware(object):
      def process_response(self, request, response):
          if 'text/html' in response['Content-Type']:
              response.content = custom_spaceless(response.content)
          return response
  
new_contents: import re
  from misc.utils import custom_spaceless
  
  class SpacelessMiddleware(object):
      def process_response(self, request, response):
          if 'text/html' in response['Content-Type']:
              response.content = custom_spaceless(response.content)
          return response
  
  class StripCookieMiddleware(object):
      strip_re = re.compile(r'(__utm.=.+?(?:; |$))')
      def process_request(self, request):
          try:
              cookie = self.strip_re.sub('', request.META['HTTP_COOKIE'])
              request.META['HTTP_COOKIE'] = cookie
          except: 
              pass        
  
subject: Add StripCookieMiddleware