On Jul 26, 1:56 pm, Joseph <[email protected]> wrote: > hi > im a newbie if u know please answer me > i just follow steps of django > websitehttp://www.djangoproject.com/documentation/0.96/templates_python/ > > create a directory under inside has two file _init_.py and > customTags.py > > content of customTags.py > > from google.appengine.ext.webapp import template > register = webapp.template.create_template_register() > @register.filter(name='test') > def test(value): > if len(value)>0: > value = 1 > return value > else: > value=0 > return value > > #test.is_safe = True > register.filter('test', test) > > and i also do this {% load customTags %} in the index.html > > but there is some wrong occur.... > > TemplateSyntaxError: 'customTags' is not a valid tag library: Could > not load template library from django.templatetags.customTags, No > module named customTags > > if u know please tell me > > tks > Joseph
You need to say what you have done exactly. Firstly, inside *which* directory have you put your custom tags file? It needs to be in a templatetags subdirectory inside an app. Secondly, the other file needs to be __init__.py, not _init_.py - two underscores each side, not one. Thirdly, are you actually using Webapp rather than Django? They are not the same. Django runs on AppEngine, but Webapp is not the same thing at all. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

