Jinja2 — шаблонизация и безопасный рендеринг
engineering
jinja2 is a Claude Code skill that provides best practices for template rendering with Jinja2, covering environment setup, filters, autoescaping, and security. It applies to HTML pages, emails, configuration files, and code generation scenarios. The skill recommends creating a single `jinja2.Environment` instance with the appropriate loader — `FileSystemLoader` for file-based templates or `PackageLoader` for installed packages — and enabling `autoescape=True` to prevent XSS. For untrusted input, `SandboxedEnvironment` is prescribed; user data must only be passed as template data, never as template code. Common pitfalls addressed include bypassing the environment by calling `Template(string)` directly and placing complex logic inside templates instead of keeping them presentation-focused.
- #jinja2
- #templating
- #python
- #html
- #security