mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #25854 -- Removed deprecated usage of template.render() with RequestContext in docs.
This commit is contained in:
committed by
Tim Graham
parent
5081adcb90
commit
32c7d93e5f
@@ -72,13 +72,13 @@ MIME type :mimetype:`application/xhtml+xml`::
|
||||
This example is equivalent to::
|
||||
|
||||
from django.http import HttpResponse
|
||||
from django.template import RequestContext, loader
|
||||
from django.template import loader
|
||||
|
||||
def my_view(request):
|
||||
# View code here...
|
||||
t = loader.get_template('myapp/index.html')
|
||||
c = RequestContext(request, {'foo': 'bar'})
|
||||
return HttpResponse(t.render(c),
|
||||
c = {'foo': 'bar'}
|
||||
return HttpResponse(t.render(c, request),
|
||||
content_type="application/xhtml+xml")
|
||||
|
||||
``render_to_response``
|
||||
|
||||
Reference in New Issue
Block a user