https://github.com/adamghill/dj-angles
Transpile HTML to the Django Template Language </>
https://github.com/adamghill/dj-angles
css django django-templates html web-components
Last synced: 3 months ago
JSON representation
Transpile HTML to the Django Template Language </>
- Host: GitHub
- URL: https://github.com/adamghill/dj-angles
- Owner: adamghill
- License: mit
- Created: 2024-09-01T20:25:48.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-03-28T12:26:03.000Z (4 months ago)
- Last Synced: 2025-04-02T12:52:10.531Z (3 months ago)
- Topics: css, django, django-templates, html, web-components
- Language: Python
- Homepage: https://dj-angles.adamghill.com
- Size: 578 KB
- Stars: 35
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
dj-angles </>



[](#contributors-)- 📖 Complete documentation: https://dj-angles.adamghill.com/
- 📦 Package: https://pypi.org/project/dj-angles/## ⭐ Features
- Use HTML-like elements in Django templates, e.g. `` instead of `{% include 'partial.html' %}`
- Can be sprinkled in as needed to enhance existing Django functionality
- Since it looks like HTML, syntax highlighting mostly "just works"
- Wraps included templates in a custom element for easier debugging and targeted CSS styling
- Support for making components with the [Shadow DOM](https://dj-angles.adamghill.com/components/#CSS-scoping)
- Integrates with Django component libraries like [django-bird](https://django-bird.readthedocs.io)
- [`call`](template-tags/call.md) and [`model`](template-tags/model.md) template tags to call functions directly from a template
- [`dateformat`](filters/dateformat.md) filter to use Python [`strftime`](https://strftime.org) formats instead of PHP when formatting dates
- Submit forms via AJAX and swap in the resulting HTML## 💥 Example
**base.html**
```html
```**index.html**
```html
Submit
If
Elif
Else
This is verbatim: {% include %}
this is a comment
This is escaped
This is not escaped
```## 📖 Documentation
To learn how to install and use `dj-angles` see the complete documentation at https://dj-angles.adamghill.com/.
## 🧩 Django Component Libraries
There are a growing number of component libraries for Django. A non-complete list:
- [Slippers](https://mitchel.me/slippers/): Build reusable components in Django without writing a single line of Python.
- [django-components](https://django-components.github.io/django-components/): Create simple reusable template components in Django.
- [django-template-partials](https://github.com/carltongibson/django-template-partials): Reusable named inline partials for the Django Template Language.
- [django-bird](https://django-bird.readthedocs.io): High-flying components for perfectionists with deadlines.
- [django-cotton](https://django-cotton.com): Enabling Modern UI Composition in Django.
- [django-viewcomponent](https://github.com/rails-inspire-django/django-viewcomponent): Build reusable components in Django, inspired by Rails ViewComponent.
- [django-unicorn](https://www.django-unicorn.com): The magical reactive component framework for Django ✨.## ✨ Inspiration
- [Web Components](https://web.dev/learn/html/template)
- [django-cotton](https://django-cotton.com) by [wrabit](https://github.com/wrabit)## 🙌 Contributors