You also may use widgets instead of "extends":
http://sniplates.readthedocs.org/en/latest/
On Friday, May 15, 2015 at 6:50:40 AM UTC+3, sacrac wrote:
>
> Thank Andre Luis :)
>
> On Wed, May 13, 2015 at 1:41 PM, André Luiz > wrote:
>
>> extends should always be on first line of file and it accep
Thank Andre Luis :)
On Wed, May 13, 2015 at 1:41 PM, André Luiz wrote:
> extends should always be on first line of file and it accepts a variable
> as argument so you can define which template should be used on your view.
>
> # views.py
> def home(request):
> if request.session.type == 1:
>
extends should always be on first line of file and it accepts a variable as
argument so you can define which template should be used on your view.
# views.py
def home(request):
if request.session.type == 1:
base = 'base.html'
else:
base = 'base_other.html'
context = {
Hi, is posible change my base template with if tag
example:
{% if request.session.type = '1' %}
{% extends "base.html"%}
{% else %}
{% extends "base_other.html"%}
{%endif%}
i have a error like that
TemplateSyntaxError at /monito/cult/
Invalid block tag: 'endif'
will to do change the ba
4 matches
Mail list logo