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

<!-- Answer -->
This error happens because Superset 5 no longer supports customizing the main 
IndexView using FAB_INDEX_VIEW in superset_config.py—this setting is now 
ignored, which leads to the AttributeError you’re seeing, even if your class is 
defined correctly. The supported way to customize the IndexView in Superset 5 
is to use FLASK_APP_MUTATOR instead of FAB_INDEX_VIEW 
[details](https://github.com/apache/superset/issues/34441).

Here’s how you can migrate your customization:

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

class SupersetDashboardIndexView(IndexView):
    @expose('/')
    def index(self) -> FlaskResponse:
        # your custom logic here
        pass

def mutate_app(app):
    from superset.extensions import appbuilder
    appbuilder.indexview = SupersetDashboardIndexView
    # register other views/links as needed

FLASK_APP_MUTATOR = mutate_app
```

Remove any FAB_INDEX_VIEW configuration from your config file. Make sure your 
FLASK_APP_MUTATOR function sets appbuilder.indexview to your custom class 
before any views are registered 
[reference](https://github.com/apache/superset/issues/34441).

If you’re running Superset in Docker Compose, place your config at 
`/app/docker/pythonpath_dev/superset_config_docker.py` (not just anywhere in 
the container), and restart your containers so the config is picked up 
[reference](https://github.com/apache/superset/discussions/25487).

If you still see errors, check your logs for import or syntax errors in your 
config file—any such error will prevent your class from being available 
[reference](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/783c0ca1-7c6e-40f8-a2d2-93300e66cc1b?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/783c0ca1-7c6e-40f8-a2d2-93300e66cc1b?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/783c0ca1-7c6e-40f8-a2d2-93300e66cc1b?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/783c0ca1-7c6e-40f8-a2d2-93300e66cc1b?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/783c0ca1-7c6e-40f8-a2d2-93300e66cc1b?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/783c0ca1-7c6e-40f8-a2d2-93300e66cc1b?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/783c0ca1-7c6e-40f8-a2d2-93300e66cc1b?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-13987212

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