(Jun-21-2018, 03:57 PM)bluefrog Wrote: In other words, what types can I have as arguments ?Variable Rules
Can make a quick test like this.
As it are now only float works.
from flask import Flask app = Flask(__name__) # @app.route('/hello/<name>') # Default string # @app.route('/hello/<int:name>') @app.route('/hello/<float:name>') def hello(name): print(type(name)) return f'Hello {name}' if __name__ == '__main__': app.run(debug=True)
Output:http://127.0.0.1:5000/hello/3.14
<class 'float'> # printed to shell
Hello 3.14