Open geoffrey-eisenbarth opened 9 months ago
django-template-partials
, which allows users to render partial templates by simply appending the partial name to the template name
I am aware of this and found it intriguing, but haven't had time to look into how they are doing it! It seems like a useful feature to support.
I'm not sure if you're aware of a similar project,
django-template-partials
, which allows users to render partial templates by simply appending the partial name to the template name, e.g.template_name = 'my_template.html#my-partial-name'
within aTemplateResponse
class-based view. I don't know the specifics of their approach (yet?), but it seems to hook into Django's Template Loaders, and if a given template name contains a#
, it splits it and renders the request partial (or block, in your case).That library does not seem to support template inheritance the way yours does (e.g., with
django-render-block
I can render a block defined in a parent template, but withdjango-template-partials
it's not possible to render a partial defined in a parent template).I'd love to be able to use a similar shorthand with your library instead of having to import and call
render_block_to_string
in each of the response generating methods of a given ClassBaseView.