diff --git a/CHANGELOG.md b/CHANGELOG.md index e50c9449bc..1d5986c457 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). - [#2898](https://github.com/plotly/dash/pull/2898) Fix error thrown when using non-existent components in callback running keyword. Fixes [#2897](https://github.com/plotly/dash/issues/2897). - [#2892](https://github.com/plotly/dash/pull/2860) Fix ensures dcc.Dropdown menu maxHeight option works with Datatable. Fixes [#2529](https://github.com/plotly/dash/issues/2529) [#2225](https://github.com/plotly/dash/issues/2225) - [#2896](https://github.com/plotly/dash/pull/2896) The tabIndex parameter of Div can accept number or string type. Fixes [#2891](https://github.com/plotly/dash/issues/2891) +- [#2908](https://github.com/plotly/dash/pull/2908) Fix when environment variables are ignored by Dash.run() at runtime. Fixes [#2902](https://github.com/plotly/dash/issues/2902) ## [2.17.1] - 2024-06-12 diff --git a/dash/dash.py b/dash/dash.py index b17ef80c96..3e5e4e4170 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -1981,9 +1981,9 @@ def delete_resource(resources): def run( self, - host=os.getenv("HOST", "127.0.0.1"), - port=os.getenv("PORT", "8050"), - proxy=os.getenv("DASH_PROXY", None), + host="127.0.0.1", + port="8050", + proxy=None, debug=None, jupyter_mode: JupyterDisplayMode = None, jupyter_width="100%", @@ -2109,6 +2109,12 @@ def run( dev_tools_prune_errors, ) + # Evaluate the env variables at runtime + + host = os.getenv("HOST", host) + port = os.getenv("PORT", port) + proxy = os.getenv("DASH_PROXY", proxy) + # Verify port value try: port = int(port)