When 2 or more dash apps are registered on the same flask server, an AssertionError is raised as unique names are not created from the dash apps. below is the sample code.
import flask
import dash
import dash_html_components as html
server = flask.Flask(name )
app1 = dash.Dash(name=‘app1’,server=server, url_base_pathname=’/app1/’)
app1.layout=html.Div(‘app1’)
app2 = dash.Dash(name=‘app2’,server=server, url_base_pathname=’/app2/’)
app2.layout=html.Div(‘app2’)
if name == ‘main ’:
server.run(host=‘127.0.0.1’)
error
AssertionError: A name collision occurred between blueprints <flask.blueprints.Blueprint object at 0x0000000009B589E8> and <flask.blueprints.Blueprint object at 0x0000000003BFB320>. Both share the same name “assets”. Blueprints that are created on the fly need unique names.
nedned
August 20, 2018, 3:10pm
2
Ah yes, that looks like an issue with the new Blueprint-based system for handling static assets I’ve created an issue here .
Thanks for the report!
Hi!! I am having the same problem. Followed the links, updated dash to the latest version …
Tried to run the sample code but it does not render anything… any ideas? what I am doing wrong?
import flask
import dash
import dash_html_components as html
server = flask.Flask(name )
app1 = dash.Dash(name=‘app1’,server=server, url_base_pathname=’/app1/’)
app1.layout=html.Div(‘app1’)
app2 = dash.Dash(name=‘app2’,server=server, url_base_pathname=’/app2/’)
app2.layout=html.Div(‘app2’)
if name == ‘main ’:
server.run(debug=True, port=8050)
This should be fixed in dash==0.26.2
## 0.26.3 - 2018-08-27
## Fixed
- Prefix assets files with `requests_pathname_prefix`. [#351](https://github.com/plotly/dash/pull/351)
## Added
- `Dash.get_asset_url` will give the prefixed url for the asset file.
## 0.26.2 - 2018-08-26
## Fixed
- Only create the assets blueprint once for app that provide the same flask instance to multiple dash instance. [#343](https://github.com/plotly/dash/pull/343)
## 0.26.1 - 2018-08-26
## Fixed
- Fix bug in `_validate_layout` which would not let a user set `app.layout` to be a function that returns a layout [(fixes #334)](https://github.com/plotly/dash/issues/334). [#336](https://github.com/plotly/dash/pull/336)
## 0.26.0 - 2018-08-20
## Added
- Added `assets_ignore` init keyword, regex filter for the assets files. [#318](https://github.com/plotly/dash/pull/318)
## 0.25.1 - 2018-08-20
This file has been truncated. show original
1 Like