Insert request.session in class based Generic view in Django
问题 I'm trying to use request.session to create a 'recent' session key and add the product pages visited by the user to make it accesible in the template, here is my view, what would you guys recommend, I can't seem to go about doing this class ProductDetail(DetailView): model = Producto template_name = 'productos/product_detail.html' def get_context_data(self, **kwargs): # Call the base implementation first to get a context context = super(ProductDetail, self).get_context_data(**kwargs) # Add in