jinja2
Skill: Jinja2
Best practices for template rendering with Jinja2 including environments, filters, autoescaping, and security.
When to Use
Apply this skill when rendering templates with Jinja2 — HTML pages, emails, configuration files, and code generation.
Environment
- Create a
jinja2.Environment(loader=..., autoescape=...)once and reuse it. - Use
FileSystemLoaderfor file-based templates,PackageLoaderfor installed packages. - Enable
autoescape=Truefor HTML templates to prevent XSS.
Templates
- Use
{{ variable }}for output,{% if/for/block %}for control flow. - Use template inheritance (
{% extends 'base.html' %}) for layout reuse. - Define custom filters for reusable transformations.
More from microsoft/debugpy
pytest
Best practices for writing and organizing tests with pytest including fixtures, parametrize, and plugins.
8requests
Best practices for HTTP client usage with Requests including sessions, error handling, and timeouts.
6flask
Best practices for Flask web development including routing, blueprints, and testing.
6django
Best practices for Django web development including models, views, templates, and testing.
5numpy
Best practices for numerical computing with NumPy including arrays, broadcasting, and vectorization.
4click
Best practices for building CLI applications with Click including commands, groups, options, and testing.
3