Answers for "django session set and get"

2

how store list in django session

if not 'saved' in request.session or not request.session['saved']:
		request.session['saved'] = [obj]
	else:
		saved_list = request.session['saved']
		saved_list.append(obj)
		request.session['saved'] = saved_list
Posted by: Guest on September-22-2020
-1

how to get data from django session

#########    Store the data ############
request.session['idempresa'] = profile.idempresa
######## now use the data ################
if 'idempresa' in request.session:
    idempresa = request.session['idempresa']
Posted by: Guest on April-30-2021

Code answers related to "django session set and get"

Python Answers by Framework

Browse Popular Code Answers by Language