
- Python Pyramid 教程
- Python Pyramid - 首頁
- Python Pyramid - 概述
- Pyramid - 環境設定
- Python Pyramid - Hello World
- Pyramid - 應用程式配置
- Python Pyramid - URL 路由
- Python Pyramid - 檢視配置
- Python Pyramid - 路由字首
- Python Pyramid - 模板
- Pyramid - HTML 表單模板
- Python Pyramid - 靜態資源
- Python Pyramid - 請求物件
- Python Pyramid - 響應物件
- Python Pyramid - 會話
- Python Pyramid - 事件
- Python Pyramid - 訊息閃現
- Pyramid - 使用 SQLAlchemy
- Python Pyramid - Cookiecutter
- Python Pyramid - 建立專案
- Python Pyramid - 專案結構
- Python Pyramid - 包結構
- 手動建立專案
- 命令列 Pyramid
- Python Pyramid - 測試
- Python Pyramid - 日誌記錄
- Python Pyramid - 安全
- Python Pyramid - 部署
- Python Pyramid 有用資源
- Python Pyramid - 快速指南
- Python Pyramid - 有用資源
- Python Pyramid - 討論
Python Pyramid - Cookiecutter
到目前為止,我們透過手動執行路由配置、新增檢視和使用模板來構建 Pyramid 應用程式。Cookiecutter 提供了一種便捷的替代方案來生成 Pyramid 專案結構。它是一個命令列實用程式,使用某些預定義的專案模板。然後可以微調專案以適應使用者可能具有的特定需求。
Cookiecutter 建立的 Python 專案是一個 Python 包。預設的應用程式邏輯可以進一步自定義。如此建立的專案結構具有極強的擴充套件性,易於分發。
Cookiecutter 實用程式由Audrey Feldroy 開發。它適用於 Python 3.7 及更高版本。Python、JavaScript、Ruby、CoffeeScript、語言或 RST、Markdown、CSS、HTML 指令碼中的專案模板可用於生成專案。Github 託管了許多預構建的專案模板,任何一個都可以使用。
從 cookiecutter 模板構建的專案是一個跨平臺包。Cookiecutter 專案生成是完全自動化的,您無需為此編寫任何程式碼。一旦呼叫 cookiecutter 命令,它就會讀取正在使用的模板並提示使用者為設定引數選擇適當的值。首先,使用 PIP 安裝程式安裝 Cookiecutter。
pip install cookiecutter
要驗證 Cookiecutter 是否已正確安裝,請執行
>>> import cookiecutter >>> cookiecutter.__version__ '1.7.3'
廣告