Repository navigation
v0.4.1
{% csrf_token %} and inclusion tags render faster. On the benchmark, csrf_token_loop goes from 12.5x to 20x faster than stock Django, and inclusion_tag from 4.1x to 6.9x.
pip install -U django-rust-templatesFaster
- Context lookups by name (used by
{% csrf_token %}, inclusion tags and other tags that read a fixed key) now do one dict probe per context layer instead of two, and no longer build a new key string for every layer. - Inclusion tags: copying
csrf_tokeninto the included template's context, building that context, and starting the child render all skip several Python calls. Each further call in a loop now costs about 2.8 µs, down from 5.0 µs.
Output stays byte-identical to stock Django. Context subclasses that override get are still called as before.