Answers for "how to redirect to the same page in django"

6

redirect django

from django.shortcuts import redirect

def my_view(request):
    # ...
    return redirect('some-view-name', foo='bar')
Posted by: Guest on April-14-2020
1

how to redirect to previous page in django

<form method="POST">
    {% csrf_token %}
    {{ form }}
    <input type="hidden" name="next" value="{{ request.path }}">
    <button type="submit">Let's Go</button>
</form>
Posted by: Guest on November-11-2020
0

redirect to the same page django

from django.http import HttpResponseRedirect


return HttpResponseRedirect(request.path_info)
Posted by: Guest on September-22-2021

Code answers related to "how to redirect to the same page in django"

Python Answers by Framework

Browse Popular Code Answers by Language