1
Fork 0

bind address configuratie item toevoegen

This commit is contained in:
Ventilaar 2021-10-30 14:27:49 +02:00
parent 5b4b212f8e
commit f8b6d8225d
2 changed files with 3 additions and 1 deletions

View File

@ -3,4 +3,5 @@
<!-- zet debug modes van flask aan met waarde True-->
<flask_debug>True</flask_debug>
<sqlite_location>database.db</sqlite_location>
<bind_address>0.0.0.0</bind_address>
</master>

View File

@ -12,6 +12,7 @@ root = tree.getroot()
# laad config items in python variabelen
flask_debug = bool(root.find('flask_debug').text == 'True') # vind node in xml en als waarde 'True' is zet True
db_location = root.find('sqlite_location').text
bind_address = root.find('bind_address').text
# initialiseer flask
app = Flask(__name__)
@ -170,4 +171,4 @@ def plot_metric_host(metric, hostname, points):
if __name__ == '__main__':
db = Mydb() # initialiseer db
app.run(debug=flask_debug) # start flask
app.run(debug=flask_debug, host=bind_address) # start flask