Don't forget inclusion_tags. They are really poorly named though, they would have been much more popular had they been called "components".
The primary difference between an inclusion_tag and an include is that with an inclusion_tag, you can define the interface of your component with much more granularity. By default, each inclusion_tag is passed an empty context, whereas an include accesses all the data in the current context. This way, an inclusion_tag provides a much better isolation.
One other advantage is, this way, if you need to include some Python logic, you don't need to do all in a single view function. So, assume that your view function responds with a page with 5 components in it. If you follow the include path, all the data preparation goes into the view. With inclusion_tag, you can basically drop to Python at any level. For example, let's say you are viewing a list of questions and answers. Views do not allow you to attach Python code at the question or answer level. You can do it, but you have to traverse inside the data for the whole feed. With an inclusion tag, you can "attach" to the processing at the question or answer level.
For Angular folks, an inclusion_tag is very much similar to an angular controller. The primary difference there is again by default, Angular components inherit all the scope (similar to JS scope or Django's include scope), whereas react by default does not pass any variables, you need to pass them explicitly as props to the children (in angular, you need to add some information at the "directive" level to achieve this level of isolation).
One alternative for keeping the scope clean while using include is to use the "only" flag though, so if you are not going to do any data processing, that is easier.
That said, the use of inclusion_tags is a bit cumbersome, and I'm not making much use of it lately since I have switched to react.js and basically building my components in JS instead.
The primary difference between an inclusion_tag and an include is that with an inclusion_tag, you can define the interface of your component with much more granularity. By default, each inclusion_tag is passed an empty context, whereas an include accesses all the data in the current context. This way, an inclusion_tag provides a much better isolation.
One other advantage is, this way, if you need to include some Python logic, you don't need to do all in a single view function. So, assume that your view function responds with a page with 5 components in it. If you follow the include path, all the data preparation goes into the view. With inclusion_tag, you can basically drop to Python at any level. For example, let's say you are viewing a list of questions and answers. Views do not allow you to attach Python code at the question or answer level. You can do it, but you have to traverse inside the data for the whole feed. With an inclusion tag, you can "attach" to the processing at the question or answer level.
For Angular folks, an inclusion_tag is very much similar to an angular controller. The primary difference there is again by default, Angular components inherit all the scope (similar to JS scope or Django's include scope), whereas react by default does not pass any variables, you need to pass them explicitly as props to the children (in angular, you need to add some information at the "directive" level to achieve this level of isolation).
One alternative for keeping the scope clean while using include is to use the "only" flag though, so if you are not going to do any data processing, that is easier.
That said, the use of inclusion_tags is a bit cumbersome, and I'm not making much use of it lately since I have switched to react.js and basically building my components in JS instead.