-1

i want to get the bear part of the http://127.0.0.1:5000/bear url

i tried methods mentioned in this answer https://stackoverflow.com/a/46176337/14713550

print(request.path)
print(request.full_path)
print(str(request.url_rule))

they returned

/
/?
/

none of this worked, how to get the required part?

user4599
  • 77
  • 3
  • 11

1 Answers1

1

add <variable_name> to your app.route then pass it to his method as argument like this :

@app.route('/<temp>')
def test(temp):

now you can use temp in your method as argument

Ali
  • 376
  • 5
  • 16