(For myself) Flask_ex (templates and static)

item

  1. I can't use template HTML in Flask! → templates
  2. The image written in the template HTML in Flask is not displayed! → static
  3. CSS corresponding to template HTML does not work in Flask! → static
  4. I want to use txt data in Flask, but I can't see it! → static

1. I can't use template HTML in Flask!

--Create a folder called templates in the same location as the working py file and put all the template HTML there!

2. The image written in the template HTML in Flask is not displayed!

--Create a folder called static in the same location as the work py file and put all the image systems there! (If there is a folder in / static / static when referencing, it will be called folder name / image name Don't forget)

3.CSS that supports template HTML does not work in Flask!

--Create a folder called static in the same location as the working py file and put all the CSS there! (Same as above)

4. I want to use txt data in Flask, but I can't see it!

--Create a folder called static in the same location as the working py file and put all the txt files there! (Same as above)

5. At the end

That's what it means

Recommended Posts

(For myself) Flask_ex (templates and static)
(For myself) Flask_3 (form, POST and GET)
python [for myself]
heroku memo (for myself)
Class methods and static methods
Freecad memorandum (for myself)
(For myself) Flask_2 (list and for, extends, and a little more)
Python memo (for myself): Array
Various class methods and static methods
Python Tkinter notes (for myself)
Pipenv usage summary (for myself)
Pitfalls and workarounds for pandas.DataFrame.to_sql
Linux Command Dictionary (for myself)
[Note] [For myself] Django command