Flask 生命週期 - Flask life cycle

前言 完全不懂 Flask life cycle 我們也可以使用 Flask 建立出一個完整的系統,但是瞭解了之後,我們可以將各種資源的調度放在 Flask life cycle 的各個節點中,這樣可以讓整個系統更有條理,以下內容皆整理自 Flask 官方文件,我也會寫一個範例 Repo 幫助讀者更有效地理解 Flask life cycle。 https://flask.palletsprojects.com/en/3.0.x/lifecycle/ Flask handle request with WSGI server 以下步驟節錄自 Python 官方文件 Browser or other client makes HTTP request. WSGI server receives request. WSGI server converts HTTP data to WSGI environ dict. WSGI server calls WSGI application with the environ. Flask, the WSGI application, does all its internal processing to route the request to a view function, handle errors, etc....

2024-05-21 · 241 words · SekiXu