Answer the question
In order to leave comments, you need to log in
How to properly use sessions in Django?
I'm trying to use sessions to work with variables in different methods (Views)
Method 1
if form.is_valid():
countries = form.cleaned_data.get('countries')
request.session['countries'] = countries
countries = request.session['countries']
Exception Type: KeyError
Exception Value: 'countries'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question