You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
363 B
Python

from django.apps import apps
if apps.is_installed('silk'):
from silk.profiling.profiler import silk_profile
else:
from functools import wraps
def silk_profile(name=None):
def profile(f):
@wraps(f)
def wrapped(*args, **kwargs):
return f(*args, **kwargs)
return wrapped
return profile