diff --git a/django_cprofile_middleware/middleware.py b/django_cprofile_middleware/middleware.py index 6c187c0..970d25f 100644 --- a/django_cprofile_middleware/middleware.py +++ b/django_cprofile_middleware/middleware.py @@ -1,4 +1,5 @@ import pstats + try: import cProfile as profile except ImportError: @@ -10,9 +11,10 @@ from django.conf import settings from django.http import HttpResponse +from django.utils.deprecation import MiddlewareMixin -class ProfilerMiddleware(object): +class ProfilerMiddleware(MiddlewareMixin): """ Simple profile middleware to profile django views. To run it, add ?prof to the URL like this: