u/0_emordnilap_a_ton

▲ 2 r/flask

I have a method/function the problem is sometimes I want to redirect to 1 route and sometimes I want to redirect to another different route. How do I accomplish this ?

I have a method/function the problem is sometimes I want to redirect to 1 route and sometimes I want to redirect to another different route. How do I accomplish this ? I can show the code if necessary. The only solution I can think of is inside the method/function is use a string

in an if elif statements but I am wondering if there is a better way and if this is secure?

```py

if x == 'redirect to route 1'

elif y == 'redirect to route 2'

```

reddit.com
u/0_emordnilap_a_ton — 1 day ago