Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

redirect to previous page django

from django.http import HttpResponseRedirect

def someview(request):
   ...
   return HttpResponseRedirect(request.META.get('HTTP_REFERER'))
Comment

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>
Comment

PREVIOUS NEXT
Code Example
Python :: convert timedelta to int 
Python :: re.compile example 
Python :: trim starting space python 
Python :: import antigravity in python 
Python :: get index of value in list if value meet condition python 
Python :: python plot groupby 
Python :: sort an array python 
Python :: python subprocess exception handling 
Python :: list variables in session tensorflow 1 
Python :: python program to switch first and second characters in a string 
Python :: django add middleware 
Python :: pass keyword python 
Python :: how do i limit decimals to only two decimals in python 
Python :: access django server from another machine 
Python :: how to add item to a list python 
Python :: matplotlib vertical line 
Python :: google translator api pyhton 
Python :: Roman to integer with python 
Python :: python get value from dictionary 
Python :: how to use fastapi ApiClient with pytest 
Python :: how to use argparse 
Python :: pygame get keypress code 
Python :: python replace line in file 
Python :: finding odd even python 
Python :: python format 001 
Python :: how to print a list of strings in python 
Python :: convert csv file into python list 
Python :: how to get value from txtbox in flask 
Python :: in python how to use exp 
Python :: legend matplotlib 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =