You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/06/19 05:44:47 UTC

[PR] docs(config): document customizing the landing page via FAB_INDEX_VIEW [superset]

rusackas opened a new pull request, #41222:
URL: https://github.com/apache/superset/pull/41222

   ### SUMMARY
   
   Adds a **"Customizing the landing page (index view)"** section to the configuration docs.
   
   Customizing the `/` route via `FAB_INDEX_VIEW` actually works in current Superset — Flask-AppBuilder resolves it during `init_app` and it overrides the default `SupersetIndexView` (`superset/initialization/__init__.py`, `flask_appbuilder/base.py:169-173`). But the mechanism and its non-obvious gotchas are undocumented, which has produced recurring confusion (e.g. #34422, where the path was thought to be unsupported and folks resorted to monkeypatching workarounds).
   
   The new section documents:
   - Setting `FAB_INDEX_VIEW` to an importable dotted path, with a working example.
   - **Subclass `SupersetIndexView`** (not bare `IndexView`) to retain the `/lang/<locale>` locale handling.
   - The class must be **importable as a real module** on `PYTHONPATH`; only uppercase names are copied out of `superset_config.py`, so referencing a class defined there only works if `superset_config` is importable by name — otherwise put the view in a separate module (relevant when loading config via `SUPERSET_CONFIG_PATH`).
   - Don't set `appbuilder.indexview` from `FLASK_APP_MUTATOR` — it runs after routes are registered, so it has no effect.
   
   Imports in the example were verified against the codebase (`FlaskResponse` is in `superset.superset_typing`; `SupersetIndexView` is importable from `superset.initialization`).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Docs-only; new subsection under "Flask app Configuration Hook" in `configuring-superset.mdx`. Netlify preview will render it.
   
   ### TESTING INSTRUCTIONS
   
   Build the docs (or view the Netlify deploy preview) and confirm the new section renders under Configuration → Configuring Superset.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(config): document customizing the landing page via FAB_INDEX_VIEW [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #41222:
URL: https://github.com/apache/superset/pull/41222#issuecomment-4748837502

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 42186b40a92ae84add72194bbf38646fff545fba |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a34d74fda32d600081bee30 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-41222--superset-docs-preview.netlify.app](https://deploy-preview-41222--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQxMjIyLS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.5GsmXgwfysrgUqEosHU_VcfUBoHizHTptFurR9CqcPk)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcrLDYAgDADQXXrWWMWocQPHAFojiQIB_Mfd5fYO7wUf3OYTjAAFqCCtXrLJ6VjpPSa3mYdLY4mv8jB85kTsV3dPlFsnRUt9O5MUDXWIONSKWSB8Pw) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-41222--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(config): document customizing the landing page via FAB_INDEX_VIEW [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #41222:
URL: https://github.com/apache/superset/pull/41222#discussion_r3440502030


##########
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

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Documentation describes unimplemented feature</b></div>
   <div id="fix">
   
   The documentation presents FAB_INDEX_VIEW as the mechanism to customize the landing page, but Superset's `configure_fab()` at `superset/initialization/__init__.py:937` hard-codes `appbuilder.indexview = SupersetIndexView` with no code path that reads `FAB_INDEX_VIEW`. Users following this guide will set the config and get no result. The fix belongs in configure_fab(), not in this documentation — add a check like `fab_index_view = self.config.get("FAB_INDEX_VIEW")` before assigning the hard-coded value.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #f89051</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(config): document customizing the landing page via FAB_INDEX_VIEW [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #41222:
URL: https://github.com/apache/superset/pull/41222#discussion_r3440765756


##########
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

Review Comment:
   `FAB_INDEX_VIEW` is read by FAB itself, not Superset. In `flask_appbuilder/base.py` `init_app()` does `_index_view = app.config.get("FAB_INDEX_VIEW"); if _index_view: self.indexview = dynamic_class_import(_index_view)`, which runs *after* our `appbuilder.indexview = SupersetIndexView` and overrides it. So the config takes effect as documented — no change needed in `configure_fab()`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(config): document customizing the landing page via FAB_INDEX_VIEW [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #41222:
URL: https://github.com/apache/superset/pull/41222#discussion_r3440766833


##########
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

Review Comment:
   <!-- Bito Reply -->
   The reviewer's suggestion is based on the assumption that `FAB_INDEX_VIEW` is not being utilized by Superset. However, as you noted, Flask-AppBuilder's `init_app()` method handles the `FAB_INDEX_VIEW` configuration internally after the initial setup. Since the configuration is correctly processed by the underlying framework, the documentation is accurate as written and no code changes are required in `configure_fab()`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(config): document customizing the landing page via FAB_INDEX_VIEW [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #41222:
URL: https://github.com/apache/superset/pull/41222


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] docs(config): document customizing the landing page via FAB_INDEX_VIEW [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41222:
URL: https://github.com/apache/superset/pull/41222#issuecomment-4748829719

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org