超可愛風 (つ✧ω✧)つ 站在田裡就能得獎?這個英文笑話太萌了

圖片
Joke (。•̀ᴗ-)✧ Why did the scarecrow win an award? Because he was outstanding in his field. 笑點解釋 (๑˃ᴗ˂)ﻭ 這個笑話的關鍵在「outstanding in his field」的雙關意思: • outstanding 可以指「表現傑出」 • 也可以拆開理解成「站在外面(out-standing)」 而 field: • 可以指「領域」 • 也可以指「田地」 所以整句話可以同時理解成: ➤ 表面意思:稻草人在他的領域表現優秀,所以得獎 (๑•̀ㅂ•́)و✧ ➤ 字面畫面:他真的只是「站在田裡」(。•́︿•̀。)

VS Code flask專案的MVC 架構與Blueprint



M(Model) 與資料庫相關的邏輯,例如 SQLAlchemy 模型。 

V(View)呈現內容,例如 HTML template 或 API 回傳 JSON。 

C(Controller) 接收請求、調用 Model、回傳 View,Flask 的路由函式就是 Controller 的角色。


Blueprint 用來將應用程式「模組化、結構化」。

可以把 Blueprint 想成「一個可以被註冊到 Flask App 的迷你應用」

Blueprint獨立定義路由、模板、靜態檔案,最後「註冊(register)」到主 App。 

專案將路由分檔案管理,

功能模組分工明確 

讓 app 結構清楚,有層次,好維護

可用多個 blueprint 分別處理不同功能區域(例如 user、admin API) 

支援重複使用 blueprint 模組 

輕鬆拆分檔案、方便多人開發

留言