You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it's commonplace for projects to use the name content for blocks within the project, two_factor's use of the same generic name makes it difficult to override _base.html for style without effectively having to override everything.
Expected Behaviour
Ideally, one should be able to create a my_app/two_factor/_base.html with contents like the following:
I currently have a account/base.html template that provides some common markup for all of my account pages. My individual account pages put their distinct content into an account_content block, and then the account/base.html templates put all of the account_content content into a content block which is then put into my main site base.html template.
Since the two_factor app uses the block name content, that nice hierarchical separation is bypassed and the two_factor content goes directly into my main site's base.html template without the proper common account_content markup surrounding it.
As it's commonplace for projects to use the name
content
for blocks within the project, two_factor's use of the same generic name makes it difficult to override_base.html
for style without effectively having to override everything.Expected Behaviour
Ideally, one should be able to create a
my_app/two_factor/_base.html
with contents like the following:Current Behavior
Django doesn't like it when you nest blocks:
Possible Solution
Rename all references from
{% block content %}
to{% block two_factor_content %}
.Context
I'm looking at writing a hackish template tag that sort of side-loads the template and writes the output so I can do this:
Not ideal, but I'd rather do this than copy/paste this project's templates into mine and hope to keep them in sync between updates.
Your Environment
The text was updated successfully, but these errors were encountered: