Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for newer versions of Django #28

Merged
merged 1 commit into from
Jun 11, 2017
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
3 changes: 2 additions & 1 deletion pyinstrument/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pyinstrument.profiler import NotMainThreadError
import time
import os
from django.utils.deprecation import MiddlewareMixin

not_main_thread_message = (
"pyinstrument can only be used on the main thread in signal mode. Run your server process in "
Expand All @@ -15,7 +16,7 @@
"https://github.com/joerick/pyinstrument#signal-or-setprofile-mode")


class ProfilerMiddleware(object):
class ProfilerMiddleware(MiddlewareMixin):
def process_request(self, request):
profile_dir = getattr(settings, 'PYINSTRUMENT_PROFILE_DIR', None)
use_signal = getattr(settings, 'PYINSTRUMENT_USE_SIGNAL', True)
Expand Down