3 ms·
It has blocks for this https://docs.djangoproject.com/en/3.0/ref/templates/builtins/#std:templatetag-extends https://docs.djangoproject.com/en/3.0/ref/templates
by __alexs 6y ago
It has blocks for this https://docs.djangoproject.com/en/3.0/ref/templates/builtins/#std:templatetag-extends https://docs.djangoproject.com/en/3.0/ref/templates/builtins...
- jungletime 6y agoThat isn't as nice to having a function inside the same file you can call over, IMHO. Also lets say you define a block for rendering a button with a different color. Then use 20 different buttons on one page. Does that mean that the block code would need to be loaded from a file 20 times and parsed each time. Seems like huge performance hit to do it that way. Is there a technical reason why you can't have a function in the same file. Am I misunderstanding how it works?