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
{{ message }}
This repository was archived by the owner on Sep 18, 2022. It is now read-only.
The HTML() element is dangerous because it goes beyond the boundaries of clean Django/Python coding and, more importantly, it has nothing to do with the layout stuff.
We all know it comes very handy sometimes when you have to add a small piece of text, but one day one could be very well type HTML("<input ... />").
I propose the following:
remove HTML() and replace it with Text("hey daddy!", attrs={'class': 'foo'}) (which renders to <p class="foo">hey daddy!</p>)
introduce TemplateInclude("foo/snippet.html") that does exactly what it says, it adds the equivalent of {% include 'foo/snippet.html' %} during template rendering.
The
HTML()element is dangerous because it goes beyond the boundaries of clean Django/Python coding and, more importantly, it has nothing to do with the layout stuff.We all know it comes very handy sometimes when you have to add a small piece of text, but one day one could be very well type
HTML("<input ... />").I propose the following:
HTML()and replace it withText("hey daddy!", attrs={'class': 'foo'})(which renders to<p class="foo">hey daddy!</p>)TemplateInclude("foo/snippet.html")that does exactly what it says, it adds the equivalent of{% include 'foo/snippet.html' %}during template rendering.