Renamed django.core.handler.CoreHandler to ModPythonHandler, in preparation for WSGI support
git-svn-id: http://code.djangoproject.com/svn/django/trunk@168 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
feeeda969c
commit
4e094e26e6
|
@ -1,5 +1,5 @@
|
||||||
import hotshot, time, os
|
import hotshot, time, os
|
||||||
from django.core.handler import CoreHandler
|
from django.core.handler import ModPythonHandler
|
||||||
|
|
||||||
PROFILE_DATA_DIR = "/var/log/cmsprofile/"
|
PROFILE_DATA_DIR = "/var/log/cmsprofile/"
|
||||||
|
|
||||||
|
@ -19,4 +19,4 @@ def handler(req):
|
||||||
profname = "%s.%.3f.prof" % (req.uri.strip("/").replace('/', '.'), time.time())
|
profname = "%s.%.3f.prof" % (req.uri.strip("/").replace('/', '.'), time.time())
|
||||||
profname = os.path.join(PROFILE_DATA_DIR, profname)
|
profname = os.path.join(PROFILE_DATA_DIR, profname)
|
||||||
prof = hotshot.Profile(profname)
|
prof = hotshot.Profile(profname)
|
||||||
return prof.runcall(CoreHandler(), req)
|
return prof.runcall(ModPythonHandler(), req)
|
||||||
|
|
|
@ -2,10 +2,10 @@ import os
|
||||||
from django.utils import httpwrappers
|
from django.utils import httpwrappers
|
||||||
|
|
||||||
# NOTE: do *not* import settings (or any module which eventually imports
|
# 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).
|
# won't be set up correctly (with respect to settings).
|
||||||
|
|
||||||
class CoreHandler:
|
class ModPythonHandler:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._request_middleware = self._view_middleware = self._response_middleware = None
|
self._request_middleware = self._view_middleware = self._response_middleware = None
|
||||||
|
@ -147,4 +147,4 @@ class CoreHandler:
|
||||||
return '\n'.join(traceback.format_exception(*sys.exc_info()))
|
return '\n'.join(traceback.format_exception(*sys.exc_info()))
|
||||||
|
|
||||||
def handler(req):
|
def handler(req):
|
||||||
return CoreHandler()(req)
|
return ModPythonHandler()(req)
|
||||||
|
|
Loading…
Reference in New Issue