Umgebung Python 3.5.0 Django 1.9.2
template.html
<form action="./?next={{ request.META.HTTP_REFERER }}" method="post">{% csrf_token %}
Anzahl der Kuchen: {{ cake_form.cake_num }}
<input type="submit" value="Senden">
</form>
views.py
from django.shortcuts import redirect
if 'next' in request.GET:
return redirect(request.GET['next'])
Recommended Posts