logoalt Hacker News

f311ayesterday at 10:02 PM3 repliesview on HN

How is it different from include? Just less files from my perspective


Replies

simonwyesterday at 10:04 PM

The "inline partials" feature is neat, means you can use and define a partial at the same time.

The way you can render just a named partial from both the render() shortcut and the include tag is nice too:

https://docs.djangoproject.com/en/6.0/ref/templates/language...

show 1 reply
agumonkeytoday at 5:23 AM

you're kinda right, {% partial ... %} vs {% include ... %} is not a big difference, but my mind was vaguely thinking that "includes" have often been seen as large templates, whereas partial have been after the component era with the idea of making small blocks. (my 2 cents)

chistevyesterday at 10:07 PM

I asked the same question