Trying to mimic the first answer in this post and create a log_error decorator: Log all errors to console or file on Django site
Here is the error that I get:
raise TypeError('view must be a callable or a list/tuple in the case of include().')
TypeError: view must be a callable or a list/tuple in the case of include().
Maybe I'm not supposed to put this function in views.py or maybe this doesn't work in Django 2.2.3?
def log_error(func):
def _call_func(*args, **argd):
try:
func(*args, **argd)
except:
print("error") #substitute your own error handling
return _call_func