Skip to content

Utilize Django Template Loaders #49

@geoffrey-eisenbarth

Description

@geoffrey-eisenbarth

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 a TemplateResponse 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 with django-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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions