What is the right way in this template?

I am editing a file:

/templates/account/base.html

and you want to include in it:

/templates/profiles/includes/sub_nav.html

I tried the following:

{% block subnav %}{% include "profiles/includes/sub_nav.html"%}{% endblock %} 

result: no error, but no sidebar enabled

and i also tried

 {% block subnav %}{% include "../profiles/includes/sub_nav.html"%}{% endblock %} 

Result: Template error page: Exception: Caught TemplateDoesNotExist when rendering: ../ profiles / includes / sub_nav.html

with the following line highlighted: {% extends "account / base.html"%}

So for below, what should be XXX as containing /templates/account/base.html?

 {% block subnav %}{% include "XXX/sub_nav.html"%}{% endblock %} 
+4
source share
1 answer

"result: no error, but no sidebar enabled."

Logical conclusion

Your sub_nav.html has problems. Or your base.html has a problem. Works. These must be HTML, CSS, or Django tags.

+1
source

All Articles