mirror of
https://github.com/django/django.git
synced 2025-09-27 04:29:17 +00:00
Refs #25978 -- Removed shortcuts.render_to_response() per deprecation timeline.
This commit is contained in:
parent
944469939b
commit
573ec714e5
6 changed files with 3 additions and 113 deletions
|
@ -1,44 +1,4 @@
|
|||
from django.shortcuts import render, render_to_response
|
||||
|
||||
|
||||
def render_to_response_view(request):
|
||||
return render_to_response('shortcuts/render_test.html', {
|
||||
'foo': 'FOO',
|
||||
'bar': 'BAR',
|
||||
})
|
||||
|
||||
|
||||
def render_to_response_view_with_multiple_templates(request):
|
||||
return render_to_response([
|
||||
'shortcuts/no_such_template.html',
|
||||
'shortcuts/render_test.html',
|
||||
], {
|
||||
'foo': 'FOO',
|
||||
'bar': 'BAR',
|
||||
})
|
||||
|
||||
|
||||
def render_to_response_view_with_content_type(request):
|
||||
return render_to_response('shortcuts/render_test.html', {
|
||||
'foo': 'FOO',
|
||||
'bar': 'BAR',
|
||||
}, content_type='application/x-rendertest')
|
||||
|
||||
|
||||
def render_to_response_view_with_status(request):
|
||||
return render_to_response('shortcuts/render_test.html', {
|
||||
'foo': 'FOO',
|
||||
'bar': 'BAR',
|
||||
}, status=403)
|
||||
|
||||
|
||||
def render_to_response_view_with_using(request):
|
||||
using = request.GET.get('using')
|
||||
return render_to_response('shortcuts/using.html', using=using)
|
||||
|
||||
|
||||
def context_processor(request):
|
||||
return {'bar': 'context processor output'}
|
||||
from django.shortcuts import render
|
||||
|
||||
|
||||
def render_view(request):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue