1

I'm trying to create a verification program where a user goes to a URL and then they get verified.

For each user, I want to create a new url example.com/verificationUser, for user 2 it'd be example.com/verificationUser2.

How can I set a "dynamic" app route in Flask?

@app_route(dynamic)
def do_this():
   return "hello"

I want the same function to run on a new app route. so both example.com/verificationUser and example.com/verificationUser2 get returned hello

Federico Baù
  • 6,013
  • 5
  • 30
  • 38
fiji
  • 228
  • 5
  • 21

1 Answers1

2

That's how you do it

@app.route('/verification/<name>')
def profile(name):
    return f'Hello {name}'
Federico Baù
  • 6,013
  • 5
  • 30
  • 38