一键导入
chameleon-flask
Adds integration of the Chameleon template language to Flask and Quart. Use when writing Python code that uses the chameleon_flask package.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Adds integration of the Chameleon template language to Flask and Quart. Use when writing Python code that uses the chameleon_flask package.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | chameleon-flask |
| description | Adds integration of the Chameleon template language to Flask and Quart. Use when writing Python code that uses the chameleon_flask package. |
| license | MIT |
| compatibility | Requires Python >=3.10. |
Adds integration of the Chameleon template language to Flask and Quart.
pip install chameleon-flask
| Need | Use |
|---|---|
| Render a Chameleon template from a Flask/Quart view | @chameleon_flask.template('home/index.pt') on the view function |
| Return a friendly 404 page from a view | chameleon_flask.not_found() |
| Build a rendered Response outside a decorated view | chameleon_flask.response(template_file, **model) |
| Get rendered HTML as a plain string | chameleon_flask.engine.render(template_file, **model) |
| Use Alpine.js/Vue shorthand attributes in templates | global_init(..., restricted_namespace=False) |
Set up the Chameleon template engine once at app startup.
global_init: Initialize the Chameleon template engineengine.clearRender templates from Flask/Quart view functions (sync or async) and return friendly 404s.
template: Decorate a Flask or Quart view method to render a Chameleon templatenot_found: Abort the current view and render a friendly 404 pageRender a template to a Response or raw HTML without the decorator.
response: Render a Chameleon template directly to a flask.Responseengine.renderErrors raised by the engine. Importable from chameleon_flask directly or from chameleon_flask.exceptions.
FlaskChameleonException: Base exception for all chameleon-flask errorsFlaskChameleonNotFoundException: Raised by not_found() to signal that a view should render a 404 page