・flaskを使って{{Hello}}の部分をこんにちはにしてみたいです。
・ファイルの構成(?)は以下のようになってます。表記の仕方がよくわからなくてごめんなさい。。。
Atom.app
views.py
templates
index.html
html
1<!DOCTYPE html> 2<html> 3<head> 4 <meta charset="utf-8"> 5 <title>Flask Test</title> 6</head> 7<body> 8 <h1>こんにちは</h1> 9 <h2>今から、学んだ知識の練習をしようと思います。</h2> 10 <p>問題1です。下の文字列を[こんにちは、Flask]に変えなさい。</p> 11 <p>{{Hello}}, Flask</p> 12</body> 13</html> 14
python
1from flask import Flask, render_template 2app = Flask(__name__) 3 4@app.route("") #ダブルクオーテーションの間には何を書けばいいのか。 5def Hello_flask(): 6 return render_template("index.html", Hello="こんにちは") 7
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/04 11:24
2019/05/04 12:06