From 3f5acf85d7b9299e4b81daa5a90621dad56c3e80 Mon Sep 17 00:00:00 2001 From: chriddyp Date: Fri, 8 Sep 2017 11:04:43 -0400 Subject: [PATCH 1/3] Add back https://github.com/plotly/dash/pull/70 This was accidentely removed in a git merge --- dash/dash.py | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/dash/dash.py b/dash/dash.py index f02bb0a09f..bfe6eb8cb0 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -67,43 +67,44 @@ def __init__( self.registered_paths = {} # urls + def add_url(name, view_func, methods=['GET']): + self.server.add_url_rule( + name, + view_func=view_func, + endpoint=name, + methds=methods + ) - self.server.add_url_rule( + add_url( '{}_dash-layout'.format(self.config.routes_pathname_prefix), - view_func=self.serve_layout) + self.serve_layout) - self.server.add_url_rule( + add_url( '{}_dash-dependencies'.format(self.config.routes_pathname_prefix), - view_func=self.dependencies) + self.dependencies) - self.server.add_url_rule( + add_url( '{}_dash-update-component'.format( self.config.routes_pathname_prefix ), - view_func=self.dispatch, - methods=['POST']) + self.dispatch, + ['POST']) - self.server.add_url_rule(( + add_url(( '{}_dash-component-suites' '/' '/').format( self.config.routes_pathname_prefix ), - view_func=self.serve_component_suites) + self.serve_component_suites) - self.server.add_url_rule( + add_url( '{}_dash-routes'.format(self.config.routes_pathname_prefix), - view_func=self.serve_routes - ) - - self.server.add_url_rule( - self.config.routes_pathname_prefix, view_func=self.index) + self.serve_routes) # catch-all for front-end routes - self.server.add_url_rule( - '{}'.format(self.config.routes_pathname_prefix), - view_func=self.index - ) + add_url( + self.config.routes_pathname_prefix, self.index) self.server.before_first_request(self._setup_server) From 49d5e08846e1cb60e2d8f5e62c669c0c5b24f691 Mon Sep 17 00:00:00 2001 From: chriddyp Date: Fri, 8 Sep 2017 11:04:53 -0400 Subject: [PATCH 2/3] v0.18.2 --- CHANGELOG.md | 10 +++++++--- dash/version.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fadfb1f27..c6f9f0790e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ -0.18.1 - 2017-09-07 +# 0.18.2 - 2017-09-07 +## Added +- 🔧 Added an `endpoint` to each of the URLs to allow for multiple routes (https://github.com/plotly/dash/pull/70) + +# 0.18.1 - 2017-09-07 ## Fixed - 🐛 If `app.layout` was supplied a function, then it used to be called excessively. Now it is called just once on startup and just once on page load. https://github.com/plotly/dash/pull/128 -0.18.0 - 2017-09-07 +# 0.18.0 - 2017-09-07 ## Changed - 🔒 Removes the `/static/` folder and endpoint that is implicitly initialized by flask. This is too implicit for my comfort level: I worry that users will not be aware that their files in their `static` folder are accessible - ⚡️ Removes all API calls to the Plotly API (https://api.plot.ly/), the authentication endpoints and decorators, and the associated `filename`, `sharing` and `app_url` arguments. This was never documented or officially supported and authentication has been moved to the [`dash-auth` package](https://github.com/plotly/dash-auth) @@ -11,7 +15,7 @@ ## Added - 🔧 Add two new `config` variables: `routes_pathname_prefix` and `requests_pathname_prefix` to provide more flexibility for API routing when Dash apps are run behind proxy servers. `routes_pathname_prefix` is a prefix applied to the backend routes and `requests_pathname_prefix` prefixed in requests made by Dash's front-end. `dash-renderer==0.8.0rc3` uses these endpoints. - 🔧 Added id to KeyError exception in components (#112) -- 🔧 Added an `endpoint` to each of the URLs to allow for multiple routes + ## Fixed - ✏️ Fix a typo in an exception diff --git a/dash/version.py b/dash/version.py index 5877c8d040..93eab7eba1 100644 --- a/dash/version.py +++ b/dash/version.py @@ -1 +1 @@ -__version__ = '0.18.1' +__version__ = '0.18.2' From 8e469fc370c7e7b46c15ed9d45a4c2de736c1d13 Mon Sep 17 00:00:00 2001 From: chriddyp Date: Fri, 8 Sep 2017 11:07:42 -0400 Subject: [PATCH 3/3] typo --- dash/dash.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dash/dash.py b/dash/dash.py index bfe6eb8cb0..bebb7efb33 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -72,7 +72,7 @@ def add_url(name, view_func, methods=['GET']): name, view_func=view_func, endpoint=name, - methds=methods + methods=methods ) add_url(