mistype, it's @register.simple_tag and not @register.simle_tag of course ...
sorry On Thu, Jul 28, 2011 at 8:39 AM, nicolas HERSOG <n.her...@gmail.com> wrote: > Hi, I m new in django too but i ll try to help you. > > In your tem_tag.py can you add : @register.simle_tag just before you def > you tag, just like this : > > @register.simle_tag > def my_tag(): > return blablabla > > > > On Thu, Jul 28, 2011 at 8:17 AM, Showket Bhat > <scorpion.sch...@gmail.com>wrote: > >> Hi All, >> >> I am using templatetags to create one tag.. I created the folder >> templatetags and created 2 files in it.. __init__.py which is empty >> and another temp_tags.py.. where i put one method >> >> temp_tags.py >> ==================== >> from django import template >> register = template.Library() >> register.filter('lower', lower) >> >> def lower(value): # Only one argument. >> # "Converts a string into all lowercase" >> return value.lower() >> >> ========================= >> template2.html >> ========================= >> >> {% load temp_tags %} >> >> This will print my name in lowercase: {{ name|lower }} >> >> ============================ >> >> I ve not inserted anything in setting.py regarding templatetags and I >> am getting this error >> >> >> ============================= >> >> TemplateSyntaxError at /view2/ >> >> 'temp_tags' is not a valid tag library: Template library temp_tags not >> found, tried >> django.templatetags.temp_tags,django.contrib.admin.templatetags.temp_tags >> >> Request Method: GET >> Request URL: http://localhost:8000/view2/ >> Django Version: 1.3 >> Exception Type: TemplateSyntaxError >> Exception Value: >> >> 'temp_tags' is not a valid tag library: Template library temp_tags not >> found, tried >> django.templatetags.temp_tags,django.contrib.admin.templatetags.temp_tags >> >> Exception Location: /usr/local/lib/python2.6/dist-packages/django/ >> template/defaulttags.py in load, line 1054 >> Python Executable: /usr/bin/python >> Python Version: 2.6.4 >> >> ================================ >> >> Please Help.... >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To post to this group, send email to django-users@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. >> >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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.