Quantcast
Channel: Active questions tagged heroku - Webmasters Stack Exchange
Viewing all articles
Browse latest Browse all 44

Using an icon in flask doesn't work on heroku

$
0
0

I'm trying to add an icon to my website using:

@app.route('/favicon.ico')def favicon():    return url_for('static', filename='images/favicon.ico')

and when i'm using the "flask generated ip" hosted on my pc it works for all the pages, even the 404 pages, but when i host it on heroku it shows only on the ' / ' page.

I also tried

<link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.ico') }}">

and

@app.route('/favicon.ico')def favicon():    return send_from_directory(os.path.join(app.root_path, 'static'),'images/favicon.ico', mimetype='image/vnd.microsoft.icon')

but I got the same result.

How can I fix it?


Viewing all articles
Browse latest Browse all 44

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>