|
Size: 858
Comment:
|
Size: 1346
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 22: | Line 22: |
| * nano flaskproj.py | === static/app.css === {{{#!highlight css .p{ text-align: center; } }}} === static/app.js === {{{#!highlight javascript document.addEventListener("DOMContentLoaded", (event) => { console.log("DOM is ready!"); }); }}} === templates/index.html === {{{#!highlight html <html> <head> <link href="static/app.css" rel="stylesheet"> <script src="static/app.js"></script> </head> <body> <p>Hello Flask</p> </body> </html> }}} === flaskproj.py === |
| Line 24: | Line 49: |
| from flask import Flask | from flask import Flask, render_template |
| Line 30: | Line 55: |
| return "<p>Hello World from Flask!</p>" | return render_template("index.html") |
Flask
- Micro web development framework
- Flask depends on the Jinja template engine and the Werkzeug WSGI toolkit.
Example
static/app.css
1 .p{ text-align: center; }
static/app.js
templates/index.html
