Closed paulrentschler closed 5 years ago
I wonder if this was removed at some point as a default context_processor? I don't use django much any longer and haven't done much testing beyond 1.4 for this codebase, to be honest. I'd really like someone to help take this project over since I don't do much python work any longer.
I will add this to the documentation, but it may be better to find a workaround that doesn't require a non-default context processor.
I'm rather new to django and did do some looking around for solutions to the problem beyond just adding the context processor but didn't really find anything. I would agree it's a less that ideal fix, but thanks for adding it to the docs.
In Django 1.7 and above, there's a different to set your context_processor. Thus you'd better use the following code instead of TEMPLATE_CONTEXT_PROCESSORS
TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [ './templates' ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [
# list if you haven't customized them:
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
],
},
},
]
I was getting this error in bootstrap_pagination.py on line 148 which calls: context['request'].GET and failed because context didn't have an entry for 'request'. In fact context was a list instead of a dictionary.
The solution was to add the following to my settings.py file:
The last line is key as the rest is the default values for TEMPLATE_CONTEXT_PROCESSORS.
Please consider adding this step to the documentation.
Tested on Django 1.5.5