コード例 #1
0
ファイル: middleware.py プロジェクト: adamnfish/DjanJinja2
 def process_request(request):
     
     """
     Attach a special ``RequestContext`` subclass to each request object.
     
     This is the only method in the ``RequestContextMiddleware`` Django
     middleware class. It attaches a ``RequestContext`` subclass to each
     request as the ``Context`` attribute. This subclass has the request
     object pre-specified, so you only need to use ``request.Context()`` to
     make instances of ``django.template.RequestContext``.
     
     Consult the documentation for ``djanjinja.views.RequestContext`` for
     more information.
     """
     
     request.Context = RequestContext.with_request(request)
コード例 #2
0
 def process_request(request):
     
     """
     Attach a special ``RequestContext`` subclass to each request object.
     
     This is the only method in the ``RequestContextMiddleware`` Django
     middleware class. It attaches a ``RequestContext`` subclass to each
     request as the ``Context`` attribute. This subclass has the request
     object pre-specified, so you only need to use ``request.Context()`` to
     make instances of ``django.template.RequestContext``.
     
     Consult the documentation for ``djanjinja.views.RequestContext`` for
     more information.
     """
     
     request.Context = RequestContext.with_request(request)