diff --git a/CHANGELOG.md b/CHANGELOG.md index 6028f4751c..82386318d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `dash` will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] +### Added +- [#1133](github.com/plotly/dash/pull/1133) Allow the `compress` config variable to be set with an environment variable with DASH_COMPRESS=FALSE + ## [1.9.0] - 2020-02-04 ### Fixed - [#1080](https://github.com/plotly/dash/pull/1080) Handle case where dash fails to load when used inside an iframe with a sandbox attribute that only has allow-scripts diff --git a/dash/_configs.py b/dash/_configs.py index c93fca5eba..0c4fae55b4 100644 --- a/dash/_configs.py +++ b/dash/_configs.py @@ -29,12 +29,13 @@ def load_dash_env_vars(): 'DASH_HOT_RELOAD_MAX_RETRY', 'DASH_SILENCE_ROUTES_LOGGING', 'DASH_PRUNE_ERRORS', + 'DASH_COMPRESS' ) } ) -DASH_ENV_VARS = load_dash_env_vars() +DASH_ENV_VARS = load_dash_env_vars() # used in tests def get_combined_config(name, val, default=None): diff --git a/dash/dash.py b/dash/dash.py index 679ed0ee9a..4a702aab6d 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -221,7 +221,7 @@ def __init__( requests_pathname_prefix=None, routes_pathname_prefix=None, serve_locally=True, - compress=True, + compress=None, meta_tags=None, index_string=_default_index, external_scripts=None, @@ -276,7 +276,9 @@ def __init__( routes_pathname_prefix=routes_prefix, requests_pathname_prefix=requests_prefix, serve_locally=serve_locally, - compress=compress, + compress=get_combined_config( + "compress", compress, True + ), meta_tags=meta_tags or [], external_scripts=external_scripts or [], external_stylesheets=external_stylesheets or [],