redirect django
from django.shortcuts import redirect
def my_view(request):
# ...
return redirect('some-view-name', foo='bar')
redirect django
from django.shortcuts import redirect
def my_view(request):
# ...
return redirect('some-view-name', foo='bar')
redirect in dajango
from django.shortcuts import render
def my_view(request):
# View code here...
return render(request, 'myapp/index.html', {
'foo': 'bar',
}, content_type='application/xhtml+xml')
django redirect url
LOGIN_REDIRECT_URL = 'your_url'
LOGOUT_REDIRECT_URL = 'your_url'
redirect in dajango
from django.http import HttpResponse
from django.template import loader
def my_view(request):
# View code here...
t = loader.get_template('myapp/index.html')
c = {'foo': 'bar'}
return HttpResponse(t.render(c, request), content_type='application/xhtml+xml')
how to redirect in django
def my_view(request):
...
return redirect('/some/url/')
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us