{"id":14990081,"url":"https://github.com/adamghill/dj-angles","last_synced_at":"2026-02-08T14:19:02.237Z","repository":{"id":255438359,"uuid":"850803852","full_name":"adamghill/dj-angles","owner":"adamghill","description":"Transpile HTML to the Django Template Language \u003c/\u003e","archived":false,"fork":false,"pushed_at":"2025-03-28T12:26:03.000Z","size":592,"stargazers_count":35,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T12:52:10.531Z","etag":null,"topics":["css","django","django-templates","html","web-components"],"latest_commit_sha":null,"homepage":"https://dj-angles.adamghill.com","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamghill.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"adamghill"}},"created_at":"2024-09-01T20:25:48.000Z","updated_at":"2025-03-28T12:26:06.000Z","dependencies_parsed_at":"2025-03-05T00:01:05.917Z","dependency_job_id":"03443591-c3f2-494d-bec6-c3725911764c","html_url":"https://github.com/adamghill/dj-angles","commit_stats":{"total_commits":92,"total_committers":2,"mean_commits":46.0,"dds":"0.010869565217391353","last_synced_commit":"13550c853ea7d2e4c752674d81177d9a56dc172c"},"previous_names":["adamghill/dj-angles"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamghill%2Fdj-angles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamghill%2Fdj-angles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamghill%2Fdj-angles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamghill%2Fdj-angles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamghill","download_url":"https://codeload.github.com/adamghill/dj-angles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999860,"owners_count":21031046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","django","django-templates","html","web-components"],"created_at":"2024-09-24T14:19:25.974Z","updated_at":"2026-02-08T14:19:02.232Z","avatar_url":"https://github.com/adamghill.png","language":"Python","funding_links":["https://github.com/sponsors/adamghill"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003edj-angles \u0026lt;/\u0026gt;\u003c/h1\u003e\n\u003c/p\u003e\n\n![PyPI](https://img.shields.io/pypi/v/dj-angles?color=blue\u0026style=flat-square)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/dj-angles?color=blue\u0026style=flat-square)\n![GitHub Sponsors](https://img.shields.io/github/sponsors/adamghill?color=blue\u0026style=flat-square)\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\n- 📖 Complete documentation: https://dj-angles.adamghill.com/\n- 📦 Package: https://pypi.org/project/dj-angles/\n\n## ⭐ Features\n\n- Use HTML-like elements in Django templates, e.g. `\u003cdj-some-partial /\u003e` instead of `{% include 'some-partial.html' %}`\n- Can be sprinkled in as needed to enhance existing Django functionality\n- Since it looks like HTML, syntax highlighting mostly \"just works\"\n- Wraps components in a custom HTML element for easier debugging and targeted CSS styling\n- Support for the [Shadow DOM](https://dj-angles.adamghill.com/en/latest/components/#css-scoping) to encapsulate component styles\n- Lightweight way to submit forms via AJAX and swap in the resulting HTML\n- Error boundaries to catch and display template errors\n\n### Component library integrations\n\n- Support for Django 6.0 [template partials](https://docs.djangoproject.com/en/stable/ref/templates/language/#template-partials)\n- [django-components](https://django-components.github.io/django-components/)\n- [django-viewcomponent](https://github.com/rails-inspire-django/django-viewcomponent)\n- [django-bird](https://django-bird.readthedocs.io)\n- [django-template-partials](https://github.com/carltongibson/django-template-partials)\n\n### Template tags\n\n- [`call`](https://dj-angles.adamghill.com/en/latest/template-tags/call/): call functions in a template\n- [`model`](https://dj-angles.adamghill.com/en/latest/template-tags/model/): call a model in a template\n- [`template`](https://dj-angles.adamghill.com/en/latest/template-tags/template/): inline template\n- [`view`](https://dj-angles.adamghill.com/en/latest/template-tags/view/): render a view in a template\n\n### Filters\n\n- [`dateformat`](https://dj-angles.adamghill.com/en/latest/filters/dateformat/): use Python [`strftime`](https://strftime.org) format for formatting dates as a string\n\n## 💥 Examples\n\n```html\n\u003c!-- base.html --\u003e\n\u003cdj-block name='content'\u003e  \u003c!-- {% block content %} --\u003e\n\u003c/dj-block\u003e  \u003c!-- {% endblock content %} --\u003e\n```\n\n```html\n\u003c!-- template-tags.html --\u003e\n\u003cdj-extends parent='base.html' /\u003e  \u003c!-- {% extends 'base.html' %} --\u003e\n\n\u003cdj-block name='content'\u003e  \u003c!-- {% block content %} --\u003e\n  \u003c!-- components --\u003e\n  \u003cdj-some-partial /\u003e  \u003c!-- {% include 'test-partial.html' %} --\u003e\n  \u003cdj-include template='test-partial.html' /\u003e  \u003c!-- {% include 'test-partial.html' %} --\u003e\n\n  \u003cdj-verbatim\u003e  \u003c!-- {% verbatim %} --\u003e\n    This is verbatim: {% include %}\n  \u003c/dj-verbatim\u003e  \u003c!-- {% endverbatim %} --\u003e\n\n  \u003cdj-comment\u003e  \u003c!-- {% comment %} --\u003e\n    this is a comment\n  \u003c/dj-comment\u003e  \u003c!-- {% endcomment %} --\u003e\n\n  \u003cdj-autoescape-on\u003e  \u003c!-- {% autoescape-on %} --\u003e\n    This is escaped\n  \u003c/dj-autoescape-on\u003e  \u003c!-- {% endautoescape %} --\u003e\n\n  \u003cdj-autoescape-off\u003e  \u003c!-- {% autoescape off %} --\u003e\n    This is not escaped\n  \u003c/dj-autoescape-off\u003e  \u003c!-- {% endautoescape %} --\u003e\n\n  \u003cdj-csrf /\u003e  \u003c!-- {% csrf_token %} --\u003e\n\n  \u003cdj-debug /\u003e  \u003c!-- {% debug %} --\u003e\n\u003c/dj-block\u003e  \u003c!-- {% endblock content %} --\u003e\n```\n\n```html\n\u003c!-- static-helpers.html --\u003e\n\u003cdj-image src='img/django.jpg' /\u003e  \u003c!-- \u003cimg src=\"{% static 'img/django.jpg' %}\" /\u003e --\u003e\n\u003cdj-css href='css/styles.css' /\u003e  \u003c!-- \u003clink href=\"{% static 'css/styles.css' %}\" rel=\"stylesheet\" /\u003e --\u003e\n```\n\n```html\n\u003c!-- call-code-from-template.html --\u003e\n\u003cdj-call code='slugify(\"Hello Goodbye\")' as='variable_name' /\u003e  \u003c!-- {% call slugify(\"Hello Goodbye\") as variable_name %} --\u003e\n\u003cdj-model code='Book.objects.filter(id=1)' as='book' /\u003e  \u003c!-- {% model Book.objects.filter(id=1) as book %} --\u003e\n\u003cdj-view name='some-view' /\u003e  \u003c!-- {% view 'some-view' %} --\u003e\n```\n\n```html\n\u003c!-- inline-expressions.html --\u003e\n{{ request.user.username or request.user.email }}  \u003c!-- {% if request.user.username %}{{ request.user.username }}{% else %}{{ request.user.email }}{% endif %} --\u003e\n{{ request.user.username if request.user.is_authenticated else 'Unknown' }}  \u003c!-- {% if request.user.is_authenticated %}{{ request.user.username }}{% else %}Unknown{% endif %} --\u003e\n```\n\n```html\n\u003c!-- error-boundaries.html --\u003e\n\u003cdj-block name='content' error-boundary\u003e\n  \u003cdj-include template='missing-template.html' /\u003e\n\u003c/dj-block\u003e\n\n\u003cdj-error-boundary\u003e\n  \u003cdj-include template='missing-template.html' /\u003e\n\u003c/dj-error-boundary\u003e\n```\n\n```html\n\u003c!-- ajax-form-submission.html --\u003e\n\u003cdj-form action='/submit' method='POST' swap='outerHTML' ajax csrf\u003e \u003c!-- \u003cajax-form\u003e\u003cform action='/submit' method='POST'\u003e{% csrf_token %} --\u003e\n  \u003cbutton type='submit'\u003eSubmit\u003c/button\u003e\n\u003c/dj-form\u003e\u003c!-- \u003c/form\u003e\u003c/ajax-form\u003e --\u003e\n```\n\n```html\n\u003c!-- conditional-attributes.html --\u003e\n\u003cdiv dj-if=\"True\"\u003e  \u003c!-- {% if True %}\u003cdiv\u003e --\u003e\n  If\n\u003c/div\u003e\n\u003cdiv dj-elif=\"False\"\u003e  \u003c!-- {% elif False %}\u003cdiv\u003e --\u003e\n  Elif\n\u003c/div\u003e\n\u003cdiv dj-else\u003e  \u003c!-- {% else %}\u003cdiv\u003e --\u003e\n  Else\n\u003c/div\u003e  \u003c!-- \u003c/div\u003e{% endif %} --\u003e\n```\n\n## 📖 Documentation\n\nTo learn how to install and use `dj-angles` see the complete documentation at https://dj-angles.adamghill.com/.\n\n## 🧩 Django Component Libraries\n\nThere are a growing number of component libraries for Django. A non-complete list:\n\n- [Slippers](https://mitchel.me/slippers/): Build reusable components in Django without writing a single line of Python.\n- [django-components](https://django-components.github.io/django-components/): Create simple reusable template components in Django.\n- [django-template-partials](https://github.com/carltongibson/django-template-partials): Reusable named inline partials for the Django Template Language.\n- [django-bird](https://django-bird.readthedocs.io): High-flying components for perfectionists with deadlines.\n- [django-cotton](https://django-cotton.com): Enabling Modern UI Composition in Django.\n- [django-viewcomponent](https://github.com/rails-inspire-django/django-viewcomponent): Build reusable components in Django, inspired by Rails ViewComponent.\n- [django-unicorn](https://www.django-unicorn.com): The magical reactive component framework for Django ✨.\n\n## ✨ Inspiration\n\n- [Web Components](https://web.dev/learn/html/template)\n- [django-cotton](https://django-cotton.com) by [wrabit](https://github.com/wrabit)\n\n## 🙌 Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://www.levit.be\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1215070?v=4?s=100\" width=\"100px;\" alt=\"Emmanuelle Delescolle\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eEmmanuelle Delescolle\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/adamghill/dj-angles/commits?author=nanuxbe\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/adamghill/dj-angles/commits?author=nanuxbe\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/adamghill/dj-angles/commits?author=nanuxbe\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://jasalt.dev\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2306521?v=4?s=100\" width=\"100px;\" alt=\"Jarkko Saltiola\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJarkko Saltiola\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/adamghill/dj-angles/commits?author=jasalt\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamghill%2Fdj-angles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamghill%2Fdj-angles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamghill%2Fdj-angles/lists"}