We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86f8f08 commit 32c2938Copy full SHA for 32c2938
02.Flask/01.Templates.py
@@ -11,6 +11,10 @@ def template():
11
return render_template("index.html")
12
#file location bydefault templates folder ka hota hai
13
14
+#static folder ka location use karne ke liye static/filename kar sakte hai
15
+#but instead hum use karte hai url_for('static', filename='fileKAnaam') - best practice
16
+#agar same inline html karna hai to {{}} ke andar use kar sakte hai - check variable.html for more info
17
+
18
#To link python variables to html
19
@app.route("/variable")
20
def variable():
02.Flask/static/logo.png
2.39 MB
02.Flask/templates/variable.html
@@ -8,7 +8,11 @@
8
</head>
9
10
<body>
<h1>Hi mera naam {{naam}} hai</h1>
+<img src = "{{ url_for('static' , filename='logo.png') }}">
</body>
0 commit comments