How to pass <str:—-> argument to REVERSE in Django? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to pass <str:—-> argument to REVERSE in Django?

I want to return(reverse()) the “EDIT” function to the url which is this -> path(“<str:search>”, views.search, name=“search”) I want to pass the “edit” (str) to the search named url!! How can I do this def edit(request, edit): ... ... context = [ ‘edit’: edit ] ... ... return redirect(‘search’ , ____) <—- argument here

1st Nov 2020, 10:31 AM
Adarsh Mamgain
Adarsh Mamgain - avatar
1 Answer
+ 2
In django You can not pass parameters with redirect. Your only bet is to pass them as a part of URL.
8th Dec 2020, 7:11 AM
alireza
alireza - avatar