On Sun, Dec 19, 2010 at 8:40 PM, Nate Reed <[email protected]> wrote:
> When I try to import my module in the shell I also am unable to import it: > > >>> from django.templatetags import mytags > Traceback (most recent call last): > File "<console>", line 1, in <module> > ImportError: cannot import name mytags > >>> from myapp.templatetags import mytags > Traceback (most recent call last): > File "<console>", line 1, in <module> > ImportError: No module named templatetags > > Does this mean something is wrong with my path or setup? Any ideas? > Looks like the myapp/templatetags directory is missing an __init__.py file. You need this in order for Python to include it in the search for modules on import. (As a side note, the error message that implies only django.templatetags was searched for your custom template tags was misleading and has been improved in newer releases.) Karen -- http://tracey.org/kmt/ -- 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.

