3π
I donβt think this is possible. Just for your specific problem I guess it can be solves if you would place the site name before the block, and use the block just to append something to the site name.
Otherwise you could define SITE_NAME
in your settings.py
and have a context processor like
from django.conf import settings
def site_name(request):
return {'SITE_NAME': settings.SITE_NAME}
so that you can use {{ SITE_NAME }}
in your templates β this could make sense because the site name could be usefule at other places tooβ¦
8π
Note, Django 1.2.3 seems to already do what you want. Assuming SITE_NAME is exposed via a context_preprocessor like lzerscience illustrates, block.super should expose it through all the layers of inheritance.
main.html
{% extends "default.html" %}
{% block title %} {{ block.super }} - MAIN{% endblock %}
That displays the title βSITE NAME β SECTION NAME β MAINβ for me.
- You cannot add messages without installing django.contrib.messages.middleware.MessageMiddleware
- Django: Built-in include tag vs custom inclusion tag
- Creating one Django Form to save two models
- How to use custom token model in Django Rest Framework
- Django unit test client response has empty context
2π
Django 1.6.6
{{ block.super.super }}
β possible
I try now β worked π
But not officially β¦
- What is the main difference between clean and full_clean function in Django?
- Django model subclassing approaches
- Django filter by datetime on a range of dates