Skip to content

Commit

Permalink
docs: document FLASK_APP_MUTATOR (apache#16286)
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnzhu authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent c58df31 commit ce725e0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/src/pages/docs/installation/configuring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,25 @@ CUSTOM_SECURITY_MANAGER = CustomSsoSecurityManager
]
```

### Flask app Configuration Hook

`FLASK_APP_MUTATOR` is a configuration function that can be provided in your environment, receives
the app object and can alter it in any way. For example, add `FLASK_APP_MUTATOR` into your
`superset_config.py` to setup session cookie expiration time to 24 hours:

```
def make_session_permanent():
'''
Enable maxAge for the cookie 'session'
'''
session.permanent = True
# Set up max age of session to 24 hours
PERMANENT_SESSION_LIFETIME = timedelta(hours=24)
def FLASK_APP_MUTATOR(app: Flask) -> None:
app.before_request_funcs.setdefault(None, []).append(make_session_permanent)
```

### Feature Flags

To support a diverse set of users, Superset has some features that are not enabled by default. For
Expand Down

0 comments on commit ce725e0

Please sign in to comment.