Metadata-Version: 2.4
Name: django-template-oxide
Version: 0.1.0
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 6.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: django>=6.0
License-File: LICENSE
Summary: A Rust implementation of Django's template engine.
Keywords: django,template,rust,performance
Home-Page: https://github.com/nickpetrovic/django-template-oxide
Author: Nick Petrovic
License-Expression: MIT
Requires-Python: >=3.14
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/nickpetrovic/django-template-oxide/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/nickpetrovic/django-template-oxide/issues
Project-URL: Repository, https://github.com/nickpetrovic/django-template-oxide

# django-template-oxide

A Rust implementation of Django's template engine. Add it as a `TEMPLATES` backend and your templates render through Rust instead of Python, with the same output, the same exceptions, and the same error messages as stock Django.

It passes 1529 of Django 6.1's own 1530 `template_tests` (one is skipped on case-insensitive file systems), plus a parity suite that renders every built-in filter, tag, lookup, and localization case through both engines and requires identical results.

This project was pair-built with Claude. See [the docs](docs/index.md) for what that means for the code.

## Install

```sh
pip install django-template-oxide
```

Requires Python 3.14+ and Django 6.0+. Wheels are published for Linux (x86_64 and arm64) and macOS (Apple Silicon), for both the regular and free-threaded builds of CPython 3.14. See [Installing](docs/install.md) to build from source.

## Use

```python
TEMPLATES = [
    {
        "BACKEND": "django_template_oxide.backend.OxideTemplates",
        "DIRS": [...],
        "APP_DIRS": True,
        "OPTIONS": {...},
    },
]
```

Nothing else changes: `render`, `get_template`, `{% extends %}`, `{% include %}`, and custom tag libraries work as before.

## Performance

Mean time per render or compile. Smaller is better.

| Workload                         | Oxide    | django-rusty-templates | Stock Django |
|----------------------------------|----------|------------------------|--------------|
| Full template, 50 rows           | 0.044 ms | 0.381 ms               | 0.805 ms     |
| Date filters, 50 rows            | 0.058 ms | 0.488 ms               | 0.854 ms     |
| `{% url %}`, 50 rows             | 0.251 ms | 0.281 ms               | 0.391 ms     |
| Inheritance (extends + 3 blocks) | 0.021 ms | not supported          | 0.187 ms     |
| Compile, 500 rows                | 3.74 ms  | 166.98 ms              | 23.04 ms     |

Measured on a MacBook Pro (Apple M5 Max, 64 GB, macOS 27.0.1). The full results, the software versions, and how to reproduce them are in [Performance](docs/performance.md).

## Documentation

- [Installing](docs/install.md)
- [Using](docs/usage.md)
- [Compatibility](docs/compatibility.md)
- [Custom tags and filters](docs/extending.md)
- [Performance](docs/performance.md)
- [Limitations](docs/limitations.md)
- [Contributing](CONTRIBUTING.md)
- [Changelog](CHANGELOG.md)

## License

MIT. See [LICENSE](./LICENSE).

