Re: best way change template base my app

2015-05-15 Thread Ilya Kazakevich
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

Re: best way change template base my app

2015-05-14 Thread carlos
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: >

Re: best way change template base my app

2015-05-13 Thread André Luiz
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 = {

best way change template base my app

2015-05-13 Thread carlos
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