I have two separate apps:
-
Flask app:
flask_app = connexion.App(__name__)
-
Dash app:
external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’]
dash_app = dash.Dash(name, external_stylesheets=external_stylesheets)
dash_app.layout = html.Div([html.H1(‘This is a base header’)])
Also, I’m working with both of them:
app = DispatcherMiddleware(flask_app, {
'/reports': dash_app.server
})
To run my app I’m writing:
run_simple(
hostname=“localhost”,
port=config[“port”],
application=app,
threaded=True,
use_debugger=True
)
More or less it’s OK, but…
When I’m sending GET request to:
http://localhost:8888/reports
I’m getting an error:
[2019-01-02 20:21:01,131] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File “/home/user/app/venv/local/lib/python2.7/site-packages/flask/app.py”, line 2292, in wsgi_app
response = self.full_dispatch_request()
File “/home/user/app/venv/local/lib/python2.7/site-packages/flask/app.py”, line 1808, in full_dispatch_request
self.try_trigger_before_first_request_functions()
File “/home/user/app/venv/local/lib/python2.7/site-packages/flask/app.py”, line 1855, in try_trigger_before_first_request_functions
func()
File “/home/user/app/venv/local/lib/python2.7/site-packages/dash/dash.py”, line 994, in _setup_server
self._validate_layout()
File “/home/user/app/venv/local/lib/python2.7/site-packages/dash/dash.py”, line 982, in _validate_layout
for component in to_validate.traverse():
AttributeError: ‘Response’ object has no attribute ‘traverse’
127.0.0.1 - - [02/Jan/2019 20:21:01] “GET /reports/ HTTP/1.1” 500 -
I was trying to play with url_base_pathname, but with no luck ;(