You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| **Create component in one step?** | ✅ <br> (place in folder) | ✅ <br> (Technically yes with single-file components) | ❌ <br> (need to register in YAML file or with function) |
642
-
| **Slots** <br> Pass HTML content between tags | ✅ | ✅ | ✅ |
643
-
| **Named Slots** <br> Designate a slot in the component template | ✅ | ✅ | ✅ (using ‘fragments’) |
644
-
| **Dynamic Components** <br> Dynamically render components based on a variable or expression | ✅ | ✅ | ❌ |
| **Create component in one step?** | ✅ <br> (place in folder) | ✅ <br> (Technically yes with single-file components) | ❌ <br> (need to register in YAML file or with function) | ✅ <br> (define with `{% partialdef %}`) |
642
+
| **Renderable from views** <br> Render a component directly from a Python view | ✅ | ✅ | ❌ | ✅ <br> (via `template#partial` syntax) |
643
+
| **Slots** <br> Pass HTML content between tags | ✅ | ✅ | ✅ | ❌ |
644
+
| **Named Slots** <br> Designate a slot in the component template | ✅ | ✅ | ✅ (using 'fragments') | ❌ |
645
+
| **Dynamic Components** <br> Dynamically render components based on a variable or expression | ✅ | ✅ | ❌ | ❌ |
Copy file name to clipboardExpand all lines: docs/docs_project/docs_project/templates/django_template_partials.html
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
1
<c-layouts.with-sidebar>
2
2
<h1>Setting up Cotton with Django Template Partials</h1>
3
3
4
+
<c-note>
5
+
<strong>Django 6.0+:</strong> Template partials are now built into Django core. The instructions below are only needed if you're using the <code>django-template-partials</code> package on Django < 6.0. For Django 6.0+, no additional configuration is required to use partials alongside Cotton.
6
+
</c-note>
7
+
4
8
<p>Both packages come with an auto-setup feature, but to get the packages working together we need to opt instead
5
9
for the corresponding 'SimpleAppConfig' from each package:</p>
0 commit comments