my helloworld_tags:
from django import template
register = template.Library()
def show_profile():
return {"eee": '333'}
register.inclusion_tag("b.html")(show_profile)
my view:
def b(request):
return render_to_response('b.html')
my html:
{% load helloworld_tags%}
dsad {{ eee }}
but only show 'dsad' ,not show 'dsad333'
why??
thanks
updated
but when i set this in c.html:
{% load helloworld_tags%}
and change the view:
def b(request):
return render_to_response('c.html')
and the b.html is:
dsad {{ eee }}
it is show nothing now ,
why ?
thanks
updated2
it is ok now ,when i add this to c.html:
{% load helloworld_tags%}
{% show_profile %}