This isn't my area of expertise, but it might help.
You might be able to introspect Allow
to find out which object it's decorating.
>>>from django.core.urlresolvers import resolve
>>>func, args, kwargs=resolve('/edit_settings/')
>>>func
Allow
You could try
>>>func.func_name
but it might not return the view function you want.
Here's what I found when I was experimenting with basic decorator functions:
>>>def decorator(func):
... def wrapped(*args,**kwargs):
... return func(*args,**kwargs)
... wrapped.__doc__ = "Wrapped function: %s" %func.__name__
... return wrapped
>>>def add(a,b):
... return(a,b)
>>>decorated_add=decorator(add)
In this case, when I tried decorated_add.func_name
it returned wrapped
. However, I wanted to find a way to return add
. Because I added the doc string to wrapped
, I could determine the original function name:
>>>decorated_add.func_name
wrapped
>>>decorated_add.__doc__
'Wrapped function: add'
Hopefully, you can find out how to introspect Allow
to find out the name of the view function, possibly by modifying the decorator function.