Skip to content

Local Django Static not loading how say should in Docs #250

@alexwolf22

Description

@alexwolf22

I've been trying for a while to load a static image asset in my App, using the Django static file infrastructure, but the recommended way to load a static as described here doesn't seem to be working.

I have an Img tag like below

import dash_html_components as html

html.Img(src='web/logos/bluewhite-02.png', height="30px")

but each time I run the appliaction the image tries to get the url at http://127.0.0.1:8000/web/logos/bluewhite-02.png when it should be /static/web/logos/bluewhite-02.png

I've tried setting the global PLOTY_DASH var serve_locally in my settings to True and False but it doesn't seem to make a difference.

I have been able to get it to load by directly entering the static URL for the image HTML component, but it isn't the way it says it should be done in your documentation.

import dash_html_components as html

html.Img(src='/static/web/logos/bluewhite-02.png', height="30px")

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions