views:

90

answers:

1

Hi,

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!

+6  A: 

Try to remove {{}} --> {% extends base_template|default:"mainpage.html" %}

luc
Yeah! Now is working. Thanks!
l3xu
So don't forget to accept the answer :)
luc