|
⇤ ← Revision 1 as of 2022-12-29 21:05:35
Size: 336
Comment:
|
← Revision 2 as of 2023-01-08 05:34:03 ⇥
Size: 927
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 2: | Line 2: |
'''Flask''' is a framework for web applications written in Python. It is a minimal 'micro framework' that offers only the bare minimum for spinning up a server. '''`flask`''' is the third-party module at the core of this framework. |
|
| Line 29: | Line 33: |
| To spin up a development server: {{{ $ python example.py * Serving Flask app "example" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) }}} |
Python Flask
Flask is a framework for web applications written in Python. It is a minimal 'micro framework' that offers only the bare minimum for spinning up a server.
flask is the third-party module at the core of this framework.
Example Application
import flask
app = flask.Flask(__name__)
@app.route('/')
def index():
return "Hello, World!"
if __name__ == '__main__':
app.run()
Usage
To spin up a development server:
$ python example.py * Serving Flask app "example" (lazy loading) * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
