'Reads url name, args, kwargs from GET parameters, reverses the url and resolves view function
Returns the result of resolved view function, called with provided args and kwargs
Since the view function is called directly, it isn\'t ran through middlewares, so the middlewares must
be added manually
The final result is exactly the same as if the request was for the resolved view.
Parametrized urls:
djangoUrl.reverse can be used with parametrized urls of $resource
In that case the reverse url is something like: /angular/reverse/?djng_url_name=orders&djng_url_kwarg_id=:id
$resource can either replace the \':id\' part with say 2 and we can proceed as usual,
reverse with reverse(\'orders\', kwargs={\'id\': 2}).
If it\'s not replaced we want to reverse to url we get a request to url
\'/angular/reverse/?djng_url_name=orders&djng_url_kwarg_id=\' which
gives a request.GET QueryDict {u\'djng_url_name\': [u\'orders\'], u\'djng_url_kwarg_id\': [u\'\']}
In that case we want to ignore the id param and only reverse to url with name \'orders\' and no params.
So we ignore args and kwargs that are empty strings.'

def process_request(self, request):

    if (request.path == self.ANGULAR_REVERSE):
        url_name = request.GET.get(u'djng_url_name')
        url_args = request.GET.getlist(u'djng_url_args', [])
        url_kwargs = {}
        url_args = filter((lambda x: x), url_args)
        for param in request.GET:
            if param.startswith(u'djng_url_kwarg_'):
                if request.GET[param]:
                    url_kwargs[param[15:]] = request.GET[param]
        url = unquote(reverse(url_name, args=url_args, kwargs=url_kwargs))
        assert (not url.startswith(self.ANGULAR_REVERSE)), u'Prevent    recursive    requests'
        request.path = request.path_info = url
        request.environ[u'PATH_INFO'] = url
        query = request.GET.copy()
        for key in request.GET:
            if key.startswith(u'djng_url'):
                query.pop(key, None)
        if six.PY3:
            request.environ[u'QUERY_STRING'] = query.urlencode()
        else:
            request.environ[u'QUERY_STRING'] = query.urlencode().encode(u'utf-8')
        request.GET = http.QueryDict(request.environ[u'QUERY_STRING'])
