· 7 years ago · Mar 17, 2018, 10:02 AM
1app.run()
2
3host, port, debug
4
5host = localhost
6port = 5000
7
8app.run(host="10.100.100.10", port=9566)
9
10app.config.update(
11 DEBUG=True,
12 SECRET_KEY='...'
13)
14
15SERVER_NAME
16
17app.config.update(
18 DEBUG=True,
19 SERVER_NAME="10.100.100.10:6500"
20)
21
22Running in 127.0.0.1:5000
23
24server_name = app.config['SERVER_NAME']
25if server_name and ':' in server_name:
26 host, port = server_name.split(":")
27 port = int(port)
28else:
29 port = 5000
30 host = "localhost"
31app.run(host=host, port=port)