Import Error when use templatetags in Django
Question: Well, when I'm trying to use 'inclusion' in Django, I met some confused
problems that I can't solve it by myself.

There is the structures for my project.

    
    
    MyProject---
                App1---
                       __init__.py
                       models.py
                       test.py
                       urls.py
                       views.py
                App2---
                       ...
                template---
                           App1---
                                  some htmls
                           App2---
                                  ...
                templatetags---
                               __init__.py
                               inclusion_cld_tags.py
                manage.py
                urls.py
                __init__.py
                settings.py
    

I have registered templatetags folder in the settings.py (Both in Installed
APPS & TEMPLATE_DIRS). But when I want to use {% load inclusion_test %} in my
html, it raise an exception like this:

    
    
    'inclusion_cld_tags' is not a valid tag library: Could not load template library from django.templatetags.inclusion_cld_tags, No module named inclusion_cld_tags
    

I think there is nothing wrong with my import work, how can I do with that?

Thanks for help!

My django version: 1.0+ My Python version: 2.6.4


Answer:   1. The templatetags folder [should live in the app folder](http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#code-layout):
    
                App1---
                   __init__.py
                   models.py
                   test.py
                   urls.py
                   views.py
                   templatetags---
                           __init__.py
                           inclusion_test.py
                              ...
    

  2. Did you registered the tag?

Example:

    
    
    register = template.Library()   
    @register.inclusion_tag('platform/templatetags/pagination_links.html')
    def pagination_links(page, per_page, link):
    

