i dont know if this is possible, but i will explain what i want try !
I made a Context Processor that will load some user information.
I need know, in this context processor, if there is a variable named “group” in the vars list that will be passed to my view, and if is, i will load up more things.
The processor only receive a REQUEST object, and i think with ONLY this is not possible.
But, with REQUEST_PATH (from request) i could make some magic (w/ urls.py) and find the exact view and variable that was choose by django. Is there a simple way to do this (or maybe … a way ? 😀 ) ?
—- solution —-
The solution (using what yasar11732 say) is something like this:
x = resolve(request.META["PATH_INFO"])
if 'group_name' in x.kwargs
do_domething()
Thanks ! 🙂
see: resolve() It does exactly what are you trying to do. Be aware that this function throws an 404 exception if it doesn’t find a match, so be ready to catch it.