django - Using python sessions to pass variable from one function to another function -


i have couple of quick questions - ~* when used code in java, used reduce usage of session variables used slow engine/occupy quite space. in python-django when trying access 1 variable in 2 functions have seen request.session('variable_name') being used solve - there other way achieve wanted or request.session way? in case request.session approach sessions slow down engine? (i apologize if lame question)

~* have list has values has saved in db table - list has iterated - model has instantiated - , has saved. if list being iterated(say 100 times) makes db call 100 times avoid that, doing transaction.atomic():

for lcc in list_course_content:    print lcc    c = course_content(title=lcc, course_id_id=crse.id)    c.save() 

am in right path or there other better approach ?

you used reduce usage of session variables in java, don't how did it. if worked there, in python work.

anyway, able use variable on different requests, have store variable somewhere. language doesn't matter.in django can set session backend, can based on inmemory storage, files or database, it's choice.

of course can store variable without using sessions.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -