Re: invalid template tag
Anyone have any suggestions on this. I've tried all recommendations and still getting same Template errors On Aug 27, 7:17 pm, nixon66wrote: > Still getting the same errors. > > On Aug 27, 7:10 pm, Javier Guerra wrote: > > > On Thu, Aug 27, 2009 at 2:03 PM, nixon66 wrote: > > > register.filter(uscurrency) > > > should be > > > register.filter ('uscurrency', uscurrency) > > > -- > > Javier --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: invalid template tag
On Thu, Aug 27, 2009 at 2:03 PM, nixon66wrote: > register.filter(uscurrency) should be register.filter ('uscurrency', uscurrency) -- Javier --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: invalid template tag
Still getting the same errors. On Aug 27, 7:10 pm, Javier Guerrawrote: > On Thu, Aug 27, 2009 at 2:03 PM, nixon66 wrote: > > register.filter(uscurrency) > > should be > > register.filter ('uscurrency', uscurrency) > > -- > Javier --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: invalid template tag
The file is mytag.py and the directory is now called templatetags On Aug 27, 4:42 pm, Daniel Rosemanwrote: > On Aug 27, 8:03 pm, nixon66 wrote: > > > I've just created a template tag as described in the documents, but > > keep getting errors. > > > In an installed app I created a directory called Templatetags. I > > created a blank __init__.py file and a file called mytag. > > Is the file called just 'mytag' or (as it should be) 'mytag.py'? Is > the directory called 'Templatetags' rather than > 'templatetags' (assuming you're on Linux, where case is significant in > filenames)? > -- > 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-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 -~--~~~~--~~--~--~---
Re: invalid template tag
Made the changes and still getting the same error. On Aug 27, 3:11 pm, Javier Guerrawrote: > i only see a couple of minimal typos, could be your problem: > > > In an installed app I created a directory called Templatetags. I > > should be 'templatetags', no capitalization. > > > created a blank __init__.py file and a file called mytag. Mytag has a > > function > > > from django import template > > > register template.Library() > > should be 'register = template.Library()' > > -- > Javier --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: invalid template tag
On Aug 27, 8:03 pm, nixon66wrote: > I've just created a template tag as described in the documents, but > keep getting errors. > > In an installed app I created a directory called Templatetags. I > created a blank __init__.py file and a file called mytag. Is the file called just 'mytag' or (as it should be) 'mytag.py'? Is the directory called 'Templatetags' rather than 'templatetags' (assuming you're on Linux, where case is significant in filenames)? -- 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-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 -~--~~~~--~~--~--~---
Re: invalid template tag
i only see a couple of minimal typos, could be your problem: > In an installed app I created a directory called Templatetags. I should be 'templatetags', no capitalization. > created a blank __init__.py file and a file called mytag. Mytag has a > function > > from django import template > > register template.Library() should be 'register = template.Library()' -- Javier --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
invalid template tag
I've just created a template tag as described in the documents, but keep getting errors. In an installed app I created a directory called Templatetags. I created a blank __init__.py file and a file called mytag. Mytag has a function from django import template register template.Library() def uscurrency(c): try: if c > 0: return '$%.2f'% c else: return '-$%.2f' % (-1*c) except TypeError: return c register.filter(uscurrency) In my template I have {% load mytag %} Yet I get this error: 'mytag' is not a valid tag library: Could not load template library from django.templatetags.mytag, No module named mytag Suggestions as to what I'm doing wrong? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---