←back to thread

379 points rbanffy | 1 comments | | HN request time: 0.001s | source
Show context
giancarlostoro ◴[] No.46210692[source]
Template partials look good, which is one of the key reasons frameworks like React are as good and popular as they are, because you can reuse small segments of code.
replies(8): >>46211187 #>>46211247 #>>46211354 #>>46211402 #>>46211982 #>>46212701 #>>46212849 #>>46213424 #
pier25 ◴[] No.46213424[source]
Amazing that Django didn't have this until 2025
replies(2): >>46215377 #>>46216931 #
Hamuko ◴[] No.46215377[source]
Wouldn’t Jinja2 macros count?
replies(1): >>46218507 #
sgt ◴[] No.46218507[source]
I stayed away from Jinja2 ... was under the impression it has lower performance. But I could have been wrong all these years.
replies(1): >>46223832 #
1. Hamuko ◴[] No.46223832[source]
>For nearly all cases, Django’s built-in template language is perfectly adequate. However, if the bottlenecks in your Django project seem to lie in the template system and you have exhausted other opportunities to remedy this, a third-party alternative may be the answer.

>Jinja2 can offer performance improvements, particularly when it comes to speed.

https://docs.djangoproject.com/en/6.0/topics/performance/#al...