[Answered ]-Where to check session in ClassView in django?

2👍

use self.request anywhere in the class based view. In your case self.request.session

def get_context_data(self, **kwargs):
    session = self.request.session
    # now use session however you want
    context = super(part_list_view, self).get_context_data(**kwargs)
    context['my_list'] = populate_nav_bar()
    return context

Leave a comment