You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/06/19 05:44:37 UTC

(superset) branch docs/customize-index-view created (now 42186b40a92)

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a change to branch docs/customize-index-view
in repository https://gitbox.apache.org/repos/asf/superset.git


      at 42186b40a92 docs(config): document customizing the landing page via FAB_INDEX_VIEW

This branch includes the following new commits:

     new 42186b40a92 docs(config): document customizing the landing page via FAB_INDEX_VIEW

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: docs(config): document customizing the landing page via FAB_INDEX_VIEW

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch docs/customize-index-view
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 42186b40a92ae84add72194bbf38646fff545fba
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Thu Jun 18 22:44:24 2026 -0700

    docs(config): document customizing the landing page via FAB_INDEX_VIEW
    
    Adds a "Customizing the landing page (index view)" section to the
    configuration docs. FAB_INDEX_VIEW works in current Superset (FAB resolves
    it during init and it overrides the default SupersetIndexView), but the
    mechanism and its gotchas are undocumented, leading to recurring confusion
    (e.g. #34422): subclass SupersetIndexView to keep locale handling, the
    class must be importable as a real module on PYTHONPATH, and setting
    appbuilder.indexview from FLASK_APP_MUTATOR is too late to take effect.
    
    Co-Authored-By: Claude Opus 4.8 <no...@anthropic.com>
---
 .../configuration/configuring-superset.mdx         | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/docs/admin_docs/configuration/configuring-superset.mdx b/docs/admin_docs/configuration/configuring-superset.mdx
index daf92b1c943..9ef6f075022 100644
--- a/docs/admin_docs/configuration/configuring-superset.mdx
+++ b/docs/admin_docs/configuration/configuring-superset.mdx
@@ -455,6 +455,51 @@ def FLASK_APP_MUTATOR(app: Flask) -> None:
     app.before_request_funcs.setdefault(None, []).append(make_session_permanent)
 ```
 
+## Customizing the landing page (index view)
+
+The page served at `/` is rendered by an index view. By default Superset registers
+`SupersetIndexView`, which redirects to `/superset/welcome/` and also adds the
+`/lang/<locale>` locale handler. You can replace it with your own view, for example
+to send users straight to a specific dashboard or to a chart list.
+
+Set `FAB_INDEX_VIEW` to the **importable dotted path** of your view class. Flask-AppBuilder
+resolves this during app initialization and uses it in place of the default:
+
+```python
+# my_overrides.py — must be importable on the PYTHONPATH
+from flask import redirect
+from superset.initialization import SupersetIndexView
+from superset.superset_typing import FlaskResponse
+from flask_appbuilder import expose
+
+
+class MyIndexView(SupersetIndexView):
+    @expose("/")
+    def index(self) -> FlaskResponse:
+        return redirect("/chart/list/")
+```
+
+```python
+# superset_config.py
+FAB_INDEX_VIEW = "my_overrides.MyIndexView"
+```
+
+A few things that commonly trip people up:
+
+- **Subclass `SupersetIndexView`, not Flask-AppBuilder's bare `IndexView`.** Subclassing
+  keeps Superset's `/lang/<locale>` locale handling; replacing it with a bare `IndexView`
+  silently drops that behavior.
+- **The class must be importable as a real module.** `FAB_INDEX_VIEW` is resolved by
+  importing the dotted path, which is independent of how `superset_config.py` itself is
+  loaded. Superset only copies **uppercase** names out of `superset_config.py` into its
+  runtime config, so a `FAB_INDEX_VIEW = "superset_config.MyIndexView"` reference only works
+  if `superset_config` is itself importable by that name on the `PYTHONPATH`. If you load
+  config via `SUPERSET_CONFIG_PATH` (an arbitrary file path), put the view in a separate
+  importable module instead and reference that module.
+- **Don't set `appbuilder.indexview` from `FLASK_APP_MUTATOR`.** The mutator runs after
+  routes are already registered, so the assignment has no effect on the `/` route. Use
+  `FAB_INDEX_VIEW` instead.
+
 ## Feature Flags
 
 To support a diverse set of users, Superset has some features that are not enabled by default. For