1from django.shortcuts import redirect
2
3def my_view(request):
4 # ...
5 return redirect('some-view-name', foo='bar')
6
1from django.shortcuts import render
2
3def my_view(request):
4 # View code here...
5 return render(request, 'myapp/index.html', {
6 'foo': 'bar',
7 }, content_type='application/xhtml+xml')
8
1from django.http import HttpResponse
2from django.template import loader
3
4def my_view(request):
5 # View code here...
6 t = loader.get_template('myapp/index.html')
7 c = {'foo': 'bar'}
8 return HttpResponse(t.render(c, request), content_type='application/xhtml+xml')
9