GitHub user dosubot[bot] added a comment to the discussion: Attribute not found 
error in superset_config.py

<!-- Answer -->
No, using FAB_INDEX_VIEW to set a custom IndexView in Superset 5.x does not 
work—this config is ignored and always results in the AttributeError you saw, 
even if your class is defined correctly. This is a breaking change: Superset 
5.x only supports customizing the IndexView via FLASK_APP_MUTATOR, not 
FAB_INDEX_VIEW. There are no exceptions or workarounds for this in 5.x 
([details](https://github.com/apache/superset/issues/34441), 
[discussion](https://github.com/apache/superset/discussions/34530), 
[issue](https://github.com/apache/superset/issues/34422)).

To customize the IndexView, define your custom class and set 
appbuilder.indexview inside a mutate_app function, then assign that function to 
FLASK_APP_MUTATOR in your config:

```python
from flask_appbuilder import expose, IndexView
from superset.typing import FlaskResponse

class SupersetDashboardIndexView(IndexView):
    @expose("/")
    def index(self) -> FlaskResponse:
        return redirect("/dashboard/list/")

def mutate_app(app):
    from superset.extensions import appbuilder
    appbuilder.indexview = SupersetDashboardIndexView

FLASK_APP_MUTATOR = mutate_app
```

Remove any FAB_INDEX_VIEW lines from your config. If you’re using Docker 
Compose, put your config at 
`/app/docker/pythonpath_dev/superset_config_docker.py` and restart your 
containers so it’s picked up. If you still see errors, check your logs for 
syntax or import errors in your config file—any such error will prevent your 
class from being available 
([source](https://github.com/apache/superset/issues/34441)).


<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*

---
<sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/73f96696-5537-45e5-82e2-097c0ad35f5e?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/73f96696-5537-45e5-82e2-097c0ad35f5e?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/73f96696-5537-45e5-82e2-097c0ad35f5e?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/73f96696-5537-45e5-82e2-097c0ad35f5e?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/73f96696-5537-45e5-82e2-097c0ad35f5e?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/73f96696-5537-45e5-82e2-097c0ad35f5e?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/73f96696-5537-45e5-82e2-097c0ad35f5e?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
 nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/34530)

GitHub link: 
https://github.com/apache/superset/discussions/34530#discussioncomment-13989166

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to