tags:

views:

67

answers:

3
+1  A: 

Ae you sure this is specifically to do with the template tag?

It sounds like the project_name directory is not on your python path. The output on the error page should show your current python path, so you can check if it is as expected.

Read this to learn how to fix it: http://djangotricks.blogspot.com/2008/09/note-on-python-paths.html

Andy Hume
Thanks for your input I have updated my question
REA_ANDREW
+1  A: 

Your project structure is, not to put too fine a point on it, a mess. Some of the many things you need to do:

  • don't use the same name for the containing directory (project) and the inner one (which should be an app name).
  • manage.py and settings.py should be in the outer level, not inside an application.
  • I don't know what the second views is - is it actually views.py? In which case it will never be used.
  • The empty files inside templatetags and views should be __init__.py, ie two underscores either side.
  • Probably the actual cause of your problem: you need a models.py inside an application, even if it's empty, for Django to load it at all - templatetags won't work without it.
Daniel Roseman
+1  A: 

The error is becaus you have wrong your folder's structure, i think you must read the docs, this tutorial (part1) explains the right structure:

You have a project that isn't same thing that app:

  • project_name
    • app_name
      • templatetags
        • getattribute.py
      • models.py
      • views.py
  • settings.py
  • manage.py

And in your INSTALLED_APPS:

INSTALLED_APPS = (
#    'django.contrib.auth',
     'django.contrib.contenttypes',
#    'django.contrib.sessions',
     'django.contrib.sites',
     'project_name.app_name',
)

That is all

diegueus9