I'm a Django beginner and I encounter an issue with django context_processors. I want use a queryset in all my template for generate a menu. But I get this error when I try to reach this page http://mysite/catalog which calls my cardabelle/catalog/views.py :
ImportError at /catalog/
No module named 'cardabelle.catalog'
Here "cardaballe" is my project name and "catalog" my application name.
Here is some interesting part (i guess) from my cardabelle/cardabelle/settings.py :
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'debug_toolbar',
'catalog',
'autoslug',
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'template')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'cardabelle.catalog.context_processors.categories',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'cardabelle.wsgi.application'
and here is my custom context in cardabelle/catalog/views.py :
def categories(request):
return Category.objects.value()
Somebody knows why django doesn't find my new custom context ?
Thanks in advance for your help !