put api_host in config

This commit is contained in:
Cayo Puigdefabregas 2022-11-07 17:08:03 +01:00
parent 41eb390e39
commit 79877d09a1
2 changed files with 3 additions and 2 deletions

View file

@ -59,6 +59,7 @@ class DevicehubConfig(Config):
) # type: str
SCHEMA = config('SCHEMA', 'dbtest')
HOST = config('HOST', 'localhost')
API_HOST = config('API_HOST', 'localhost')
MIN_WORKBENCH = StrictVersion('11.0a1') # type: StrictVersion
"""The minimum version of ereuse.org workbench that this devicehub
accepts. we recommend not changing this value.

View file

@ -55,7 +55,7 @@ class SettingsView(GenericMixin):
return flask.render_template(self.template_name, **self.context)
def download(self):
url = "https://{}/api/inventory/".format(app.config['HOST'])
url = "https://{}/api/inventory/".format(app.config['API_HOST'])
self.wbContext = {
'token': self.get_token(),
'url': url,
@ -65,7 +65,7 @@ class SettingsView(GenericMixin):
# if is a v14 version
# TODO when not use more v14, we can remove this if
if 'erease' in self.opt:
url = "https://{}/actions/".format(app.config['HOST'])
url = "https://{}/actions/".format(app.config['API_HOST'])
self.wbContext['url'] = url
self.wbContext['host'] = app.config['HOST']
self.wbContext['schema'] = app.config['SCHEMA']