Commit fcf81362 authored by Romain Loth's avatar Romain Loth

ini config also for helper app

parent 68a2a795
...@@ -5,15 +5,20 @@ TODO integrate with new regcomex server ...@@ -5,15 +5,20 @@ TODO integrate with new regcomex server
""" """
from extractDataCustom import MyExtractor as MySQL from extractDataCustom import MyExtractor as MySQL
from flask import Flask, request from flask import Flask, request
from json import dumps from json import dumps
from os import environ from os import environ
from configparser import ConfigParser
# ============= app creation ============== # ============= app creation ==============
app = Flask(__name__) app = Flask(__name__)
# ============= read environ ============== # ============= read environ ==============
MY_SQL_HOST = environ.get('SQL_HOST', '172.17.0.2') MY_SQL_HOST = environ.get('SQL_HOST', None)
if not MY_SQL_HOST:
ini = ConfigParser()
ini.read("../parametres_comex.ini")
MY_SQL_HOST = ini['services']['SQL_HOST']
# ================= views ================= # ================= views =================
# @app.route("/getJSON") # route renamed # @app.route("/getJSON") # route renamed
......
SQL_HOST = 172.17.0.2 [services]
SQL_HOST = 172.18.0.2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment