Problem statement
I'm trying to set the favicon for my QuasarPages in a JustPy web app, adding the attribute favicon="book_icon_32.png"
to my QuasarPage. When looking at the page source in my browser results in the following in the page head:
<link rel="shortcut icon" href=http://127.0.0.1:8080/static/book_icon_32.png>
I get the same result if instead I use
home_page.favicon = "book_icon_32.png"
The problem is that I can't figure out where the image file needs to be placed in the project tree, or if I'm missing some JustPy/Quasar object.
Can someone point me in the right direction?
More details, and some of the things I've tried.....
My project directory (in PyCharm, if that makes a difference) has main.py
which contains jp.justpy(port=8080)
in the root directory, and all the JustPy webpage classes in <root>/webapp. I've tried putting the file in:
- <root>/static
- <root>/webpage/static
and other places/relative URIs, all with the same result (blank page icon). After looking at the Quasar docs on static content, I also tried "public" directories for the image file.
- <root>/public
- <root>/webapp/public
and even putting copies of the .png file in the <root> and <webapp> directories. I've also tried looking at http://127.0.0.1:8080/static after all of these attempts, and all I get in the browser is
{"detail":"Not Found"}
And a few other things, all with no luck.
Of course, lots of Googling, searching Stack Overflow, trying to find any bread crumbs in the JustPy and Quasar docs, etc. I've also looked for examples that explicitly show the use of a favicon in other JustPy questions here and of course, I couldn't find any fully-worked examples elsewhere where there's a favicon used.
Time to stop thrashing around and ask for help.
FWIW, from my source:
home_page = jp.QuasarPage(title=AppConstants.APP_TITLE, favicon="book_icon_32.png", tailwind=True)