My question involves passing variables from the template to view in Django.
I know of passing variables in the URL and through a form. The problem I have with the first
There are broadly 3 ways to hold onto this kind of information:
Just stuff the data you want into the request.session dictionary; it'll persist per-user, and you can access it easily:
# view1
request.session['name1'] = male_results
request.session['userid1'] = male_pic_userid
# view2 (or elsewhere in view1)
male_results = request.session.get('name1')
male_pic_userid = request.session.get('userid1')
POST, page content is dictated by the URL and session data — URLs are no longer unique, and users can't share a particular page that relies on session info