Working data gathering, showing data

This commit is contained in:
Colin Maudry
2022-03-20 21:05:45 +01:00
parent b67bf183f8
commit befbf2914a
2 changed files with 64 additions and 32 deletions
+7 -5
View File
@@ -9,22 +9,24 @@ pio.templates.default = "none"
app.layout = html.Div([
dcc.Store(id='memory'),
dcc.Location(id='url', refresh=False),
html.Div(id='page-content')
html.Div(id='page-content'),
html.Div(id='debug')
])
@app.callback(Output('page-content', 'children'),
# Output('debug', 'children'),
Input('url', 'pathname'))
def display_page(pathname):
if pathname.startswith('/siret/'):
return siret.layout
return [siret.layout]
else:
return '404'
return ['Page inconnue...', pathname]
if __name__ == '__main__':
port = getenv('PORT', 8050)
# Scalingo requires 0.0.0.0 as host, instead of the default 127.0.0.1
app.run_server(debug=True, host='0.0.0.0', port=int(port))