code: def process_request(self, request):
          
          domain, host = map(lower,
              (self.get_domain_for_request(request), request.get_host()))
  
          pattern = r'^(?:(?P<subdomain>.*?)\.)?%s(?::.*)?$' % re.escape(domain)
          matches = re.match(pattern, host)
  
          if matches:
              request.subdomain = matches.group('subdomain')
          else:
              request.subdomain = None
              logger.warning('The host %s does not belong to the domain %s, '
                  'unable to identify the subdomain for this request',
                  request.get_host(), domain)
docs: Adds a ``subdomain`` attribute to the ``request`` parameter.