Folded django.core.handler.CoreHandler.get_request() into CoreHandler.call()

git-svn-id: http://code.djangoproject.com/svn/django/trunk@164 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-07-18 03:13:02 +00:00
parent dd85d8da10
commit f3a43a2dd4
1 changed files with 2 additions and 6 deletions

View File

@ -18,13 +18,14 @@ class CoreHandler:
# that use settings now can work # that use settings now can work
from django.conf import settings from django.conf import settings
from django.core import db from django.core import db
from django.core.extensions import DjangoRequest
# if we need to set up middleware, now that settings works we can do it now. # if we need to set up middleware, now that settings works we can do it now.
if self._request_middleware is None: if self._request_middleware is None:
self.load_middleware() self.load_middleware()
try: try:
request = self.get_request(req) request = DjangoRequest(req)
response = self.get_response(req.uri, request) response = self.get_response(req.uri, request)
finally: finally:
db.db.close() db.db.close()
@ -72,11 +73,6 @@ class CoreHandler:
if hasattr(mw_instance, 'process_response'): if hasattr(mw_instance, 'process_response'):
self._response_middleware.insert(0, mw_instance.process_response) self._response_middleware.insert(0, mw_instance.process_response)
def get_request(self, req):
"Returns an HttpRequest object for the given mod_python req object"
from django.core.extensions import DjangoRequest
return DjangoRequest(req)
def get_response(self, path, request): def get_response(self, path, request):
"Returns an HttpResponse object for the given HttpRequest" "Returns an HttpResponse object for the given HttpRequest"
from django.core import db, exceptions, urlresolvers from django.core import db, exceptions, urlresolvers