Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6482fdb

Browse files
committed
Flask
1 parent a238e85 commit 6482fdb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2550,7 +2550,7 @@ def serve_file(filename):
25502550
def serve_html(sport):
25512551
return flask.render_template_string('<h1>{{title}}</h1>', title=sport)
25522552
```
2553-
* **Use `'render_template(filename, <kwargs>)'` to render template file.**
2553+
* **Use `'render_template(filename, <kwargs>)'` to render file located in templates dir.**
25542554
* **To return an error code use `'abort(<int>)'` and to redirect use `'redirect(<url>)'`.**
25552555
* **`'request.args[<str>]'` returns parameter from the query string (URL part after '?').**
25562556
* **Use `'session[key] = value'` to store session data like username, etc.**

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2094,7 +2094,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
20942094
</code></pre></div>
20952095

20962096
<ul>
2097-
<li><strong>Use <code class="python hljs"><span class="hljs-string">'render_template(filename, &lt;kwargs&gt;)'</span></code> to render template file.</strong></li>
2097+
<li><strong>Use <code class="python hljs"><span class="hljs-string">'render_template(filename, &lt;kwargs&gt;)'</span></code> to render file located in templates dir.</strong></li>
20982098
<li><strong>To return an error code use <code class="python hljs"><span class="hljs-string">'abort(&lt;int&gt;)'</span></code> and to redirect use <code class="python hljs"><span class="hljs-string">'redirect(&lt;url&gt;)'</span></code>.</strong></li>
20992099
<li><strong><code class="python hljs"><span class="hljs-string">'request.args[&lt;str&gt;]'</span></code> returns parameter from the query string (URL part after '?').</strong></li>
21002100
<li><strong>Use <code class="python hljs"><span class="hljs-string">'session[key] = value'</span></code> to store session data like username, etc.</strong></li>

0 commit comments

Comments
 (0)