code: def get_current_url(request, ignore_params=None):
      
      if ignore_params is None:
          ignore_params = set()
      protocol = u'https' if request.is_secure() else u"http"
      service_url = u"%s://%s%s" % (protocol, request.get_host(), request.path)
      if request.GET:
          params = copy_params(request.GET, ignore_params)
          if params:
              service_url += u"?%s" % urlencode(params)
      return service_url
docs: Giving a django request, return the current http url, possibly ignoring some GET parameters
  
          :param django.http.HttpRequest request: The current request object.
          :param set ignore_params: An optional set of GET parameters to ignore
          :return: The URL of the current page, possibly omitting some parameters from
              ``ignore_params`` in the querystring.
          :rtype: unicode