Hi Brian, I'm facing a similar issue, which is being discussed here: http://groups.google.com/group/django-users/browse_thread/thread/0ce299d4922461f0/3cf7427097e67153#3cf7427097e67153
I am as surprised as you are by this behaviour... On Feb 5, 11:52 am, Brian Luft <[EMAIL PROTECTED]> wrote: > Hello, > > I'm setting up James Bennett's Coltrane app (yes I'm aware that it is > released as is, with no guarantees). I wrote a templatetag that > intends to pull all the Links instances and make them available to the > render context. However, in the tag file, something funny seems to > happen with the import path. I have: > > from coltrane.models import Link > > I get: > TemplateSyntaxError at /blog/ > 'coltrane_utils' is not a valid tag library: Could not load template > library from django.templatetags.coltrane_utils, No module named > models. I've seen reports that templatetag errors sometimes bubble up > as something different than what the actual problem is so I dug a > little deeper. > > When I did a set_trace, code execution goes from my tag file to: > /path/to/coltrane/templatetags/coltrane.py. > > Execution dies when it gets to: > from coltrane import Entry, Link inside that templatetag file. > > The question is why is my import statement directing execution to the > templatetag file in the coltrane app? The expected behavior is that > execution would go to coltrane/models.py - as verified by testing my > import statement from the shell. It seems that the templatetag import > machinery is altering the import path. I tried doing a test using a > model from an app of my own and did not encounter the same problem. > Furthermore, if I rename the templatetag file in coltrane (/coltrane/ > templatetags/coltrane.py) to something else eg. coltrane_tags.py then > my templatetag works fine. Is it bad practice to name a templatetag > file the same as the app? Have I discovered a bug? Suggestions, > workarounds tremendously appreciated. > > -Brian --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---