code: def target(self):
          
          target = self.path or '/'
          if self.query:
              target = '{}?{}'.format(target, self.query)
          return target
docs: The "target" i.e. local part of the URL, consisting of the path and query.