Django

Code

Changeset 168

Show
Ignore:
Timestamp:
07/18/05 01:10:00 (3 years ago)
Author:
adrian
Message:

Renamed django.core.handler.CoreHandler? to ModPythonHandler?, in preparation for WSGI support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/bin/profiling/handler.py

    r3 r168  
    11import hotshot, time, os 
    2 from django.core.handler import CoreHandler 
     2from django.core.handler import ModPythonHandler 
    33 
    44PROFILE_DATA_DIR = "/var/log/cmsprofile/" 
     
    77    ''' 
    88    Handler that uses hotshot to store profile data. 
    9      
     9 
    1010    Stores profile data in PROFILE_DATA_DIR.  Since hotshot has no way (that I 
    1111    know of) to append profile data to a single file, each request gets its own 
     
    1313    the request path with "/" replaced by ".", and <n> is a timestamp with 
    1414    microseconds to prevent overwriting files. 
    15      
     15 
    1616    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. 
    1818    ''' 
    1919    profname = "%s.%.3f.prof" % (req.uri.strip("/").replace('/', '.'), time.time()) 
    2020    profname = os.path.join(PROFILE_DATA_DIR, profname) 
    2121    prof = hotshot.Profile(profname) 
    22     return prof.runcall(CoreHandler(), req) 
     22    return prof.runcall(ModPythonHandler(), req) 
  • django/trunk/django/core/handler.py

    r167 r168  
    33 
    44# 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 
    66# won't be set up correctly (with respect to settings). 
    77 
    8 class CoreHandler: 
     8class ModPythonHandler: 
    99 
    1010    def __init__(self): 
     
    148148 
    149149def handler(req): 
    150     return CoreHandler()(req) 
     150    return ModPythonHandler()(req)