[Django]-Using resolve on url with query params in django

3👍

resolve() and reverse() do not work on query parameters.

What you can do is: Resolve URL and then append your query parameter

"%s?url=home", resolve('/tracking/url/') (see this answer)

If you want to use request.GET.get(...), why don’t you redirect to a view which uses request.GET.get(...)?

from django.shortcuts import redirect
from django.core.urlresolvers import resolve

def someViewFunction():
    ...
    url = "%s?url=home", resolve('/tracking/url/')
    return redirect(url)

If this does not help, try specifying your problem.

Leave a comment