Search code examples
pythonflaskapache-superset

How can I embed Superset Apache into Flask web app?


I have a flask web application with many pages where users can insert some data stored in mysql using sqlalchemy. I would create another page with an interactive dashboard. I googled and I found superset that it seems perfect for my app. It's possible embed apache superset (or similar) into my web app? There are some tutorial?


Solution

  • It is possible to embed Apache Superset in any web application using iframe. Copy the URL of the dashboard that you want to embed and add ?standalone=true at the end. This URL can be used in the iframe to render the application.

    Problem with the solution:

    In the above mentioned method you will be seeing login page inside the iframe when you access the dashboard. You will have to login to the web application and then login to Superset.

    Possible solutions

    1. You can make the dashboard public as mentioned in the doc: https://superset.incubator.apache.org/security.html?highlight=public#public
    2. Implement a custom authenticator as mentioned in the post: https://medium.com/@sairamkrish/apache-superset-custom-authentication-and-integrate-with-other-micro-services-8217956273c1

    I would recommend the second approach as it would give protection to your data.