+ 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 ответ
+ 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