title: Inclusion tag error ..... Invalid template library specified. ImportError raised when trying to load
body: <p>index.html has a block containing the context from a view called init in the crudapp app.Index.html also has a block called sidebar_files which I trying to populate using an inclusion tag.
  I have created an inclusion tag in fileuploader/templatetags/fileuploader_tags.py,</p>
  
  <pre><code>from django.db import models
  from .models import FileModel
  from django import template
  register = template.Library()
  
  @register.inclusion_tag('sidebar_files.html')
  def file_sharing_sidebar():
      file_model = FileModel.objects.all().reverse()
      return {'file_model': file_model}
  </code></pre>
  
  <p>Also that directiory does contain an empty <strong>inti</strong>.py file (using double underscores).
  In the project template files I have the sidebar_files.html with the load tags,</p>
  
  <pre><code>{% load fileuploader_tags %}
  {% block sidebar %}
      {% for item in file_model %}
        .... blah .....
      {% endfor %}
    {% endif %}
  &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>The app is included in INSTALLED_APPS. 
  My main index.html file used the fileuploader_tag and tries to use the sidebar_file.html template like this,</p>
  
  <pre><code>{% load staticfiles %}
  {% load fileuploader_tags %}
  ......
  {% block sidebar %} {% file_sharing_sidebar %}{% endblock %}
  </code></pre>
  
  <p>I have restarted the dev server. The error I get is,</p>
  
  <blockquote>
    <p>Invalid template library specified. ImportError raised when trying to
    load 'fileuploader.templatetags.fileuploader_tags': No module named
    models</p>
  </blockquote>
  
  <p>and specifically mentions this line from crudapp/view.py </p>
  
  <blockquote>
    <p>return render(request, 'forum.html', context)</p>
  </blockquote>
  
  <p>and is specific to the main view called 'init' which sends its context to forum.html. This template is a block in index.html. Here is the 'init' view,</p>
  
  <pre><code>def init(request):
      postModel = list(PostModel.objects.raw('SELECT *, max(pub_date), count(topic_id) AS freq, count(DISTINCT author) AS contributors FROM crudapp_postmodel GROUP BY topic_id ORDER BY pub_date DESC'))
      paginator = Paginator(postModel, 8)
      page2 = request.GET.get('page')
      try:
          forum_model = paginator.page(page2)
      except PageNotAnInteger:
          # If page is not an integer, deliver first page.
          forum_model = paginator.page(1)
      except EmptyPage:
          # If page is out of range (e.g. 9999), deliver last page of results.
          forum_model = paginator.page(paginator.num_pages)
  
      blogModel = BlogModel.objects.all().order_by('pub_date').reverse()
      paginator = Paginator(blogModel, 5)
      page = request.GET.get('blog')
      try:
          blog_model = paginator.page(page)
      except PageNotAnInteger:
          # If page is not an integer, deliver first page.
          blog_model = paginator.page(1)
      except EmptyPage:
          # If page is out of range (e.g. 9999), deliver last page of results.
          blog_model = paginator.page(paginator.num_pages)
      # context = {'blog_model': blog_model}
  
      totalposts = PostModel.objects.annotate(Count('post'))
      totalusers = User.objects.annotate(Count('id'))
      totalfiles = FileModel.objects.filter(approved=True).annotate(Count('upload'))
      totalarticles = BlogModel.objects.filter(approved=True).annotate(Count('article'))
      totalviews = TopicModel.objects.aggregate(numviews = Sum('views'))
      # If there are topis with no posts the number of topics below will still be correct
      totaltopics = PostModel.objects.aggregate(numtopics = Count('topic__id', distinct=True))
      context = {'blog_model': blog_model, 'forum_model': forum_model, 'current_time':   timezone.now(), 'totalarticles': totalarticles, 'totalfiles': totalfiles, 'totalposts': totalposts, 'totaltopics': totaltopics, 'totalusers': totalusers, 'totalviews': totalviews}
      return render(request, 'forum.html', context)
  </code></pre>
  
  <p>I have used the inclusion tag before once, successfully, but can't get it to work here.
  Any help would be greatly appreciated,</p>
  
  <p>Thanks</p>