Reputation:
I'm trying to put variable from context processor into tag template 'extends':
{% extends {{ base_template|default:"mainpage.html" }} %}
but I got an exception:
Exception Value: 'extends' takes one argument
my context_processors.py:
from django.conf import settings
def search(request):
"""Adds settings for test"""
return {
'base_template' : settings.BASE_TEMPLATE,
}
and settings.py:
...
BASE_TEMPLATE = "test/base.html"
...
Can you help me with that? Thanks!
Upvotes: 3
Views: 2077
Reputation: 1
{% extands %}
{% extands 'anotherpage.html'%}
like
{% extands %}
{% extands 'base.html'%}
Upvotes: 0
Reputation: 43096
Try to remove {{}}
--> {% extends base_template|default:"mainpage.html" %}
Upvotes: 11