[Django]-How to redirect to an explicitly named url in Django?

0👍

3👍

You can pass a view name and it’s arguments to redirect. Looks like you want the user-feed view?

redirect('user-feed', username=first_user)

0👍

You can use below code to redirect

return redirect('/accounts/twitter')

'/accounts/twitter' is your url where you want to move. we create these urls in urls.py file

you can also use below code to move on particular site

def my_view(request):
    ...
    return redirect('https://example.com/')

Leave a comment