Favicon placement (when using Python, Flask, Heroku)

The favicon is not reflected!

The favicon was not displayed at all. I didn't understand even if I looked it up. Favicon placement`` Favicon location If you look it up in, it will appear "in the root directory" and "in the same hierarchy as index.html". There was also a story that "If you write a link in the HTML head (even an images file), it's okay."

Isn't it? ?? ?? スクリーンショット 2020-05-31 20.07.28.png

It's different from a site that has only HTML and CSS!

HTML, CSS

project
├ index.html
├ favicon.ico  ←--Root, index.Same hierarchy as html
├ css
│ └ stylesheet.css
└ images
  └ photo.png

When JS joins

project
├ index.html
├ favicon.ico  ←--Root, index.Same hierarchy as html
├ css
│ └ stylesheet.css
├ js
│ └ common.js
└ images
  └ photo.png

It's kind of like that, but when I looked it up, it came out. It has to change with the addition of Flask. Search by combining the Flask Python favicon folder layout.

project
├ static
│ ├ css
│ │ └ stylesheet.css
│ ├ js
│ │ └ common.js
│ ├ images
│ │ └ favicon.ico  ←--┐
│ └ favicon.ico  ←--In static (or even in images)
├ templates
│ └ index.html
├ app.py
└ servise.db
スクリーンショット 2020-06-01 13.39.40.png

The static file had to be in static. Remember that it's the same as putting a link in the HTML head (CSS, JS). The page I made for Flask practice at the programming school also looked like this, so I should have seen it properly. Also, since it was another worker who created this back-end folder, I used it without thinking about the reason why the layout was different.

reference

[How do I deploy a favicon on Heroku? ](Https://www.it-swarm.dev/ja/favicon/heroku%E3%81%AB%E3%83%95%E3%82%A1%E3%83%93%E3%82%B3% E3% 83% B3% E3% 82% 92% E3% 83% 87% E3% 83% 97% E3% 83% AD% E3% 82% A4% E3% 81% 99% E3% 82% 8B% E3% 81% AB% E3% 81% AF% E3% 81% A9% E3% 81% 86% E3% 81% 99% E3% 82% 8C% E3% 81% B0% E3% 82% 88% E3% 81% 84% E3% 81% A7% E3% 81% 99% E3% 81% 8B% EF% BC% 9F / 956952696 / "it-swarm.dev") Adding a favicon

Recommended Posts

Favicon placement (when using Python, Flask, Heroku)
Run LINE Bot implemented in Python (Flask) "without using Heroku"
Precautions when using pit in Python
Next, use Python (Flask) for Heroku!
[Python] Be careful when using print
Precautions when using phantomjs from python
When using MeCab with virtualenv python
Precautions when using six with Python 2.5
[VS Code] ~ Tips when using python ~
When using regular expressions in Python
[python, multiprocessing] Behavior for exceptions when using multiprocessing
Easy web app with Python + Flask + Heroku
How to upload with Heroku, Flask, Python, Git (4)
How to start Python (Flask) when EC2 starts
[Python] Split a large Flask file using Blueprint
Start using Python
Character encoding when using csv module of python 2.7.3
LINE heroku python
A memorandum for touching python Flask on heroku
Scraping using Python
What are you using when testing with Python?
Initial settings when using the foursquare API in python
How to upload with Heroku, Flask, Python, Git (Part 3)
[Heroku] Memo for deploying Python apps using Heroku on Windows [Python]
Error due to conflict between python when using gurobi
Check types_map when using mimetypes on AWS Lambda (Python)
Installation method when using RealSense from Python (pyenv edition)
Causes when python version cannot be changed using pyenv
Solution if you crash when using selenium on heroku
How to upload with Heroku, Flask, Python, Git (Part 1)
Troublesome story when using Python3 with VScode on ubuntu
How to upload with Heroku, Flask, Python, Git (Part 2)
How to exit when using Python in Terminal (Mac)
[Python] I tried running a local server using flask
Error when executing Python commands without using Anaconda Prompt
Minimum memo when using Python on Mac (pyenv edition)
What I was addicted to when using Python tornado
Minimum notes when using Python on Mac (Homebrew edition)
Operate Redmine using Python Redmine
Summary when using Fabric
Fibonacci sequence using Python
Data analysis using Python 0
Data cleaning using Python
Using Python #external packages
WiringPi-SPI communication using Python
Age calculation using python
Suppress python3 flask logging
Search Twitter using Python
Name identification using python
Notes using Python subprocesses
Precautions when using Chainer
Try using Tweepy [Python2.7]
Programming with Python Flask
A memorandum of stumbling on my personal HEROKU & Python (Flask)
A memo when creating a directed graph using Graphviz in Python
Create Heroku, Flask, Python, Nyanko bulletin boards with "csv files"
Note links that may be useful when using Python, Selenium2
Solve the Japanese problem when using the CSV module in Python.
Things to keep in mind when using Python with AtCoder
Scripts that can be used when using bottle in Python
Things to keep in mind when using cgi with python.