hi the level of directory(named templateTags) is same with the model.py and main.py and i put both __init__.py customTags.py and under templateTags
for sure the name __init__.py is correct i run on AppEngine not Django would u tell me more detail about this and thanks answering my question tks Joseph On Jul 26, 9:04 pm, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Jul 26, 1:56 pm, Joseph <josephli...@gmail.com> 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 django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.