Flask Documentation (1.1.x)
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 Setup Define Hosted options Self-hosted options Becoming Big Read the Source. Hook. Extend. Subclass. Wrap with middleware. Fork. Scale like a pro. Discuss with the community. API Reference If you are looking for information html#module-logging] docs for more information. Read more on Application Errors. Hooking in WSGI Middleware To add WSGI middleware to your Flask application, wrap the application’s wsgi_app attribute. For example,0 码力 | 428 页 | 895.98 KB | 1 年前3Flask Documentation (1.1.x)
4.13 Hooking in WSGI Middleware To add WSGI middleware to your Flask application, wrap the application’s wsgi_app attribute. For example, to apply Werkzeug’s ProxyFix middleware for running behind Nginx: Nginx: from werkzeug.middleware.proxy_fix import ProxyFix app.wsgi_app = ProxyFix(app.wsgi_app) Wrapping app.wsgi_app instead of app means that app still points at your Flask application, not at the middle- dispatcher middleware into a larger one that is dispatched based on prefix. For example you could have your main application run on / and your backend interface on /backend: from werkzeug.middleware.dispatcher0 码力 | 291 页 | 1.25 MB | 1 年前3
共 2 条
- 1
相关搜索词