[Python] Setting favicon for nicegui app, visible on one port but not the other

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to set a favicon for my app with following code (main):

    app.mount("/static", StaticFiles(directory="static"), name="static")
    ui.run(storage_secret="THIS_NEEDS_TO_BE_CHANGED", host="0.0.0.0", title="My App", favicon="static/favicon-16x16v2.ico")


    I made sure favicon-16x16v2.ico is a 16x16 ico-image. And i can access the image under the adress http://127.0.0.1:8080/static/favicon-16x16.ico. However the favicon is only visible under http://localhost:8080 but not under http://127.0.0.1:8080.

    Why is that and how can I make my favicon visible on the other adresses as well?

    I am working on a linux system using Python 3.10. I use the Mozilla Firefox Browser for opening the app; other browsers show the same results.

    Continue reading...

Compartilhe esta Página