Allowing config flag to turn off flask-compress (#4617)

This commit is contained in:
Maxime Beauchemin 2018-03-15 17:17:04 -07:00 committed by GitHub
parent e2bd40c89f
commit 1e0bcba568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -173,6 +173,9 @@ work on Windows so the `superset runserver` command is not expected to work
in that context. Also note that the development web
server (`superset runserver -d`) is not intended for production use.
If not using gunicorn, you may want to disable the use of flask-compress
by setting `ENABLE_FLASK_COMPRESS = False` in your `superset_config.py`
Flask-AppBuilder Permissions
----------------------------

View File

@ -168,7 +168,8 @@ module_datasource_map.update(app.config.get('ADDITIONAL_MODULE_DS_MAP'))
ConnectorRegistry.register_sources(module_datasource_map)
# Flask-Compress
Compress(app)
if conf.get('ENABLE_FLASK_COMPRESS'):
Compress(app)
# Hook that provides administrators a handle on the Flask APP
# after initialization

View File

@ -405,6 +405,10 @@ DB_CONNECTION_MUTATOR = None
# return "-- [SQL LAB] {username} {dttm}\n sql"(**locals())
SQL_QUERY_MUTATOR = None
# When not using gunicorn, (nginx for instance), you may want to disable
# using flask-compress
ENABLE_FLASK_COMPRESS = True
try:
if CONFIG_PATH_ENV_VAR in os.environ:
# Explicitly import config module that is not in pythonpath; useful