Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renamed django.core.handler.CoreHandler to ModPythonHandler, in prepa…

…ration for WSGI support

git-svn-id: http://code.djangoproject.com/svn/django/trunk@168 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4e094e26e6ada89a2810eb1ff335f22ef6a5ca5d 1 parent feeeda9
@adrianholovaty adrianholovaty authored
Showing with 8 additions and 8 deletions.
  1. +5 −5 django/bin/profiling/handler.py
  2. +3 −3 django/core/handler.py
View
10 django/bin/profiling/handler.py
@@ -1,22 +1,22 @@
import hotshot, time, os
-from django.core.handler import CoreHandler
+from django.core.handler import ModPythonHandler
PROFILE_DATA_DIR = "/var/log/cmsprofile/"
def handler(req):
'''
Handler that uses hotshot to store profile data.
-
+
Stores profile data in PROFILE_DATA_DIR. Since hotshot has no way (that I
know of) to append profile data to a single file, each request gets its own
profile. The file names are in the format <url>.<n>.prof where <url> is
the request path with "/" replaced by ".", and <n> is a timestamp with
microseconds to prevent overwriting files.
-
+
Use the gather_profile_stats.py script to gather these individual request
- profiles into aggregated profiles by request path.
+ profiles into aggregated profiles by request path.
'''
profname = "%s.%.3f.prof" % (req.uri.strip("/").replace('/', '.'), time.time())
profname = os.path.join(PROFILE_DATA_DIR, profname)
prof = hotshot.Profile(profname)
- return prof.runcall(CoreHandler(), req)
+ return prof.runcall(ModPythonHandler(), req)
View
6 django/core/handler.py
@@ -2,10 +2,10 @@
from django.utils import httpwrappers
# NOTE: do *not* import settings (or any module which eventually imports
-# settings) until after CoreHandler has been called; otherwise os.environ
+# settings) until after ModPythonHandler has been called; otherwise os.environ
# won't be set up correctly (with respect to settings).
-class CoreHandler:
+class ModPythonHandler:
def __init__(self):
self._request_middleware = self._view_middleware = self._response_middleware = None
@@ -147,4 +147,4 @@ def _get_traceback(self):
return '\n'.join(traceback.format_exception(*sys.exc_info()))
def handler(req):
- return CoreHandler()(req)
+ return ModPythonHandler()(req)
Please sign in to comment.
Something went wrong with that request. Please try again.