erikflowers / weather-icons

215 Weather Themed Icons and CSS
https://github.com/erikflowers/weather-icons
6.95k stars 855 forks source link

Cannot load icons on local host #224

Closed mschreider closed 4 years ago

mschreider commented 4 years ago

I am having issues loading the icons on my localhost. The font files and css files in their correct directories, but when I deploy my flask app on my localhost the images are just empty boxes. If i load my html files from it's local path, the icons appear. I really do not know what I am doing wrong here. Please help me!!

Screen Shot 2020-04-17 at 4 25 47 PM Screen Shot 2020-04-17 at 4 24 29 PM Screen Shot 2020-04-17 at 4 31 24 PM Screen Shot 2020-04-17 at 4 25 33 PM Screen Shot 2020-04-17 at 4 26 26 PM

roman-holovin commented 4 years ago

As you can see from console errors, your web server returns 404 HTTP error code for font files, which means that webserver haven't found those files for URLs requested.

Most likely, this issue has nothing to do with weathericons font and your webserver is either misconfigured or URLs to font files are wrong (they do look suspect, @font-face URLs should be URLs, not a file paths, but maybe there is a post-processing involved that I don't know about).

Either way, I suggest you to look into Flask documentation for serving static files.

mschreider commented 4 years ago

@roman-holovin I fixed my issue. After looking into Flask documentation for serving static files, I modified my Flask app to this app = Flask(__name__, static_url_path="/static"). Thank you for pointing me in the right direction!

fox91 commented 4 years ago

Hi @mschreider, can I close the issue?

mschreider commented 4 years ago

Yes you can.

On Fri, May 15, 2020 at 11:00 AM Andrea Falco notifications@github.com wrote:

Hi @mschreider https://github.com/mschreider, can I close the issue?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/erikflowers/weather-icons/issues/224#issuecomment-629282584, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOKURVT2RPBM6KYXHZY4SZLRRVKI3ANCNFSM4MLAUTEQ .

-- Matthew Schreider

fox91 commented 4 years ago

Thank you