FLASK routine을 사용하여 템플릿 만들기 【Windows.ver】
저장 이름은 templates 복수형! (template의 단수형이 아니므로 주의)
2. templates 폴더 안에
index.html 파일 만들기

3. index.html의 코드는 아래와 같이 기술한다

3. 아래와 같이 render_template과 1행째에 추기하는 것으로 template를 호출할 수 있다.

name 지정
"return"에서 "index.html"뒤에 name_value = name을 추가합니다.
4. 브라우저를 열면 템플릿이 표시됨

또한 Step up!
index.html 파일에
{% if 문 %}로 파이썬 코드를 작성할 수 있습니다.
쓰기 견본

{%if name_value %}
hello.py 파일에서
이름이 지정되면 이름이 표시됩니다.
⇒이 경우 Hello Flask가 표시됩니다.
{%else%}
hello.py 파일에서
이름이 지정되지 않으면
Hi, This is a pen로 표시됨
{%endif%}
if 문을 종료하기위한 명령
Reference
이 문제에 관하여(FLASK routine을 사용하여 템플릿 만들기 【Windows.ver】), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/procons/items/2ec7fd107024837a5226텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)