Announcing Dash Bio 1.0.0 🎉 : a one-stop-shop for bioinformatics and drug development visualizations.

Dash bootstrap dbc.CardImg doesn't work after embedding Dash app into a Flask app


I have first created cards with images which worked great, using the following example:

card = dbc.Card(
        dbc.CardImg("src=app.get_asset_url('image.png')", top=True),
                html.H4("Card title", className="card-title"),
                    "Some quick example text to build on the card title and "
                    "make up the bulk of the card's content.",
                dbc.Button("Go somewhere", color="primary"),
    style={"width": "18rem"},

After embedding the dash app within the flask app all dash bootstrap components are working except the dbc.CardImg is not loading.

I have changed the part

dbc.CardImg("src=app.get_asset_url('image.png')", top=True)


dbc.CardImg(src="app/assets/image.png", top=True)

but that doesn’t load the picture either (it finds the picture but cannot load it)

Is there anything I should have done when the app is embedded?



Issue resolved at the following link: Dash bootstrap dbc.CardImg doesn’t work after embedding Dash app into a Flask app · Issue #477 · facultyai/dash-bootstrap-components · GitHub