[Fixed]-Django templates – using block.super in included template fails (exception)

20πŸ‘

From the docs:

Note

The include tag should be considered as an implementation of "render this subtemplate and include the HTML", not as "parse this subtemplate and include its contents as if it were part of the parent". This means that there is no shared state between included templates β€” each include is a completely independent rendering process.

If you want block.super to work then you need to use extends instead.

2πŸ‘

I know it a bit too late but I may have some solution. Using django-sekizai you can load js and css into one place. Take a look at http://django-sekizai.readthedocs.org/en/latest/

πŸ‘€James

Leave a comment