I am using django generic views, how do I get access to the request in my template.
URLs:
file_objects = {
'queryset' : File.objects.filter(is_good=True),
}
urlpatterns = patterns('',
(r'^files/', 'django.views.generic.list_detail.object_list', dict(file_objects, template_name='files.html')),
)
After some more searching, while waiting on people to reply to this. I found:
You need to add this to your settings.py
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request',
)
This means that by default the request will be passed to all templates!