Ни один из приведенных ответов не решил мою проблему, поэтому для тех, кто наткнулся на этот желающий доступ к объекту запроса в шаблоне общего вида, вы можете сделать что-то подобное в своем urls.py:
.
from django.views.generic import ListView
class ReqListView(ListView):
def get_context_data(self, **kwargs):
# Call the base implementation first to get a context
c = super(ReqListView, self).get_context_data(**kwargs)
# add the request to the context
c.update({ 'request': self.request })
return c
url(r'^yourpage/$',
ReqListView.as_view(
# your options
)
)
Ура! * * 1004