1👍
✅
I work for New Relic, and we’re aware of this issue. To avoid it, you can use the ‘wraps()’ decorator from the standard library ‘functools’ module to wrap the inner decorator function, like this:
import functools
def decorator(f):
@functools.wraps(f)
def _decorator():
f()
return _decorator
@decorator
def foo():
pass
See this doc for more details: https://newrelic.com/docs/python/python-tips-and-tricks#decorators_and_introspection
1👍
Have a look at functools.wrap this will make sure the __name__
attribute of the decorated function is not the name of the decorator (but that it keeps the name of the inner function)
- [Answered ]-Django returning 403 Error — "CSRF cookie not set"
- [Answered ]-Django frontend and backend seperation for security
Source:stackexchange.com