docs: def get_draft_url(url):
      """
      Return the given URL with a draft mode HMAC in its querystring.
      """
      if verify_draft_url(url):
          # Nothing to do. Already a valid draft URL.
          return url
      # Parse querystring and add draft mode HMAC.
      url = urlparse.urlparse(url)
      salt = get_random_string(5)
      # QueryDict requires a bytestring as its first argument
      query = QueryDict(force_bytes(url.query), mutable=True)
      query['preview'] = '%s:%s' % (salt, get_draft_hmac(salt, url.path))
      # Reconstruct URL.
      parts = list(url)
      parts[4] = query.urlencode(safe=':')
      return urlparse.urlunparse(parts)