I can get the view function from request.path:
from django.core.urlresolvers import resolve
view_func, _args, _kwargs = resolve(request.path)
However, I need something more. I need to take a list of view names, like ['edit_foo', 'delete_foo'], and find out if the current URL is for one of those.
I’ve come up with a couple ideas using some internals from django.core.urlresolvers, but I want something that will be efficient and somewhat correct (ie, not hacky, ideally documented).
After writing that long question, I figured it out :/ (posting for whoever else runs into this, by chance). It’s quite simple:
I must have been mistaken about the
resolvefunction’s usefulness, which is vast.