Skip to content

Commit

Permalink
Merge pull request #343 from plotly/fix-assets-x2
Browse files Browse the repository at this point in the history
Only create an assets blueprint if it's not registered.
  • Loading branch information
T4rk1n committed Aug 27, 2018
2 parents 8d1c9ce + c51f2c3 commit 2c1d39f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 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)
Expand Down
9 changes: 5 additions & 4 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ def __init__(
# allow users to supply their own flask server
self.server = server or Flask(name, static_folder=static_folder)

self.server.register_blueprint(
flask.Blueprint('assets', 'assets',
static_folder=self._assets_folder,
static_url_path=assets_url_path))
if 'assets' not in self.server.blueprints:
self.server.register_blueprint(
flask.Blueprint('assets', 'assets',
static_folder=self._assets_folder,
static_url_path=assets_url_path))

env_configs = _configs.env_configs()

Expand Down
2 changes: 1 addition & 1 deletion dash/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.26.1'
__version__ = '0.26.2'

0 comments on commit 2c1d39f

Please sign in to comment.