def ignore_static(f):
 @wraps(f)
 def decorated_function(*args, **kwargs):
  if request.path.startswith('/static'):
   return
  return f(*args, **kwargs)
 return decorated_function

def ignore_static ( f ) : @ wraps ( f ) def decorated_function ( * args , ** kwargs ) : if request . path . startswith ( '/static' ) : return return f ( * args , ** kwargs ) return decorated_function
only executes the wrapped function if were not loading a static resource .