To do a redirect to the current page with a new parameter in the flask?

Hello.
The problem is quite trivial, but the solutions I have more than 2 days scratching their heads.

<div class="currenty-converter">
 <form method="post" action id="currency-set">
 <div class="current-currency">
 <span class="cur-label">Show prices in:</span><strong>{{price}}</strong>
</div>
 <ul class="currency-list currency-toogle">
the <li>
 <a title="Dollar (USD)" href>Dollars (USD) </a>
</li>
the <li>
 <a title="virtually any (BYN)" href>Rubles (BYN)</a>
</li>
</ul>
</form>
</div>


There is such a simple form in base.html and the challenge is simply to be able to choose from a list the type of currency, after which the current page is reloaded and the setting changed.

I know how to do it by passing parameter to another page using url_for, I know how to do it with AJAX, but in both cases I have to specify a specific route when the task is to leave the person on the current page, and not even fundamentally important, reboot it, or do it in dynamics, without rebooting.
July 4th 19 at 23:02
1 answer
July 4th 19 at 23:04
Works without `context_processor`, and not quite as necessary, but it works :) :

<div class="currenty-converter">
 <form method="post" action id="currency-set">
 <div class="current-currency">
 <span class="cur-label">Show prices in: </span><strong>{{request.args.get('v')}}</strong>

</div>
 <ul class="currency-list currency-toogle">
the <li>
 <a title="Dollar (USD)" href="{{url_for(request.endpoint, v='USD')}}">us Dollars (USD) </a>
</li>
the <li>
 <a title="virtually any (BYN)" href="{{url_for(request.endpoint, v='BYN')}}">Rubles (BYN)</a>
</li>
</ul>
</form>
 </div>

It remains to understand how this to make this the default option present on all pages, and adding other parameters in the GET does not remove it.

Find more questions by tags FlaskJinja2