Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Adrian Holovaty authored July 18, 2005
10  django/bin/profiling/handler.py
... ...
@@ -1,22 +1,22 @@
1 1
 import hotshot, time, os
2  
-from django.core.handler import CoreHandler
  2
+from django.core.handler import ModPythonHandler
3 3
 
4 4
 PROFILE_DATA_DIR = "/var/log/cmsprofile/"
5 5
 
6 6
 def handler(req):
7 7
     '''
8 8
     Handler that uses hotshot to store profile data.
9  
-    
  9
+
10 10
     Stores profile data in PROFILE_DATA_DIR.  Since hotshot has no way (that I
11 11
     know of) to append profile data to a single file, each request gets its own
12 12
     profile.  The file names are in the format <url>.<n>.prof where <url> is
13 13
     the request path with "/" replaced by ".", and <n> is a timestamp with
14 14
     microseconds to prevent overwriting files.
15  
-    
  15
+
16 16
     Use the gather_profile_stats.py script to gather these individual request
17  
-    profiles into aggregated profiles by request path. 
  17
+    profiles into aggregated profiles by request path.
18 18
     '''
19 19
     profname = "%s.%.3f.prof" % (req.uri.strip("/").replace('/', '.'), time.time())
20 20
     profname = os.path.join(PROFILE_DATA_DIR, profname)
21 21
     prof = hotshot.Profile(profname)
22  
-    return prof.runcall(CoreHandler(), req)
  22
+    return prof.runcall(ModPythonHandler(), req)
6  django/core/handler.py
@@ -2,10 +2,10 @@
2 2
 from django.utils import httpwrappers
3 3
 
4 4
 # NOTE: do *not* import settings (or any module which eventually imports
5  
-# settings) until after CoreHandler has been called; otherwise os.environ
  5
+# settings) until after ModPythonHandler has been called; otherwise os.environ
6 6
 # won't be set up correctly (with respect to settings).
7 7
 
8  
-class CoreHandler:
  8
+class ModPythonHandler:
9 9
 
10 10
     def __init__(self):
11 11
         self._request_middleware = self._view_middleware = self._response_middleware = None
@@ -147,4 +147,4 @@ def _get_traceback(self):
147 147
         return '\n'.join(traceback.format_exception(*sys.exc_info()))
148 148
 
149 149
 def handler(req):
150  
-    return CoreHandler()(req)
  150
+    return ModPythonHandler()(req)

0 notes on commit 4e094e2

Please sign in to comment.
Something went wrong with that request. Please try again.