Flask Documentation (1.1.x)palletsprojects.com/p/jinja/] template engine and the Werkzeug [https://www.palletsprojects.com/p/werkzeug/] WSGI toolkit. The documentation for these libraries can be found at: Jinja documentation [http://jinja Accessing Request Data Redirects and Errors About Responses Sessions Message Flashing Logging Hooking in WSGI Middleware Using Flask Extensions Deploying to a Web Server Tutorial Project Layout Application non-relational data persistence as appropriate, and take advantage of framework-agnostic tools built for WSGI, the Python web interface. Flask includes many hooks to customize its behavior. Should you need more0 码力 | 428 页 | 895.98 KB | 1 年前3
Flask Documentation (1.1.x)a full reference in the API section. Flask depends on the Jinja template engine and the Werkzeug WSGI toolkit. The documentation for these libraries can be found at: • Jinja documentation • Werkzeug non-relational data persistence as appropriate, and take advantage of framework-agnostic tools built for WSGI, the Python web interface. Flask includes many hooks to customize its behavior. Should you need more These distributions will be installed automatically when installing Flask. • Werkzeug implements WSGI, the standard Python interface between applications and servers. • Jinja is a template language that0 码力 | 291 页 | 1.25 MB | 1 年前3
Flask入门教程Star 数量最多的 Python Web 框架,没有之一。 Flask 是典型的微框架,作为 Web 框架来说,它仅保留了核心功能:请求响应处理 和模板渲染。这两类功能分别由 Werkzeug(WSGI 工具库)完成和 Jinja(模板渲 染库)完成,因为 Flask 包装了这两个依赖,我们暂时不用深入了解它们。 主页 这一章的主要任务就是为我们的程序编写一个简单的主页。主页的 URL 一般就是 production WARNING: Do not use the development server in a production env ironment. Use a production WSGI server instead. * Debug mode: off * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) 现在打开浏览器,访问 如果你把上面的程序保存成其他的名字,比如 hello.py,接着执行 flask run 命 令会返回一个错误提示。这是因为 Flask 默认会假设你把程序存储在名为 app.py 或 wsgi.py 的文件中。如果你使用了其他名称,就要设置系统环境变量 FLASK_APP 来告诉 Flask 你要启动哪个程序。 Flask 通过读取这个文件对应的模块寻找要运行的程序实例,你可以把它设置成下0 码力 | 127 页 | 7.62 MB | 1 年前3
共 3 条
- 1













