Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion django_cprofile_middleware/middleware.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pstats

try:
import cProfile as profile
except ImportError:
Expand All @@ -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:
Expand Down