Hi:) I have got a small problem with template double extends system. I have got a scheme:
base.html ---> index.html ---> something.html
When I log in to the site I have got access to all invisible blocks (invisible blocks for anonymous users) like:
{% if user.is_superuser %}
blabla
{% endif %}
So “blabla” is visible for me, because I am a superuser and I’m logged in. It works fine in base.html, index.html but it doesn’t work in something.html. Why?? Simple it looks like user: ‘superuser’ is log out.
Are you passing the request context to render_to_response (or HttpResponse)?
Information about logged in user must be stored in the context (see documentation), and you have to do it explicitly.
Generic views automatically do it, but if you are using your own view for something.html, with a direct call to render_to_response, then you do not have information about the user.
Therefore, the code in the view should look something like: