Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

print out session information django

# Paste this in your views.py file and replace 'yourView' below
from django.shortcuts import HttpResponse

def yourView(request): 
  if request.method:
    strOne = ''
    for key, value in request.session.items():
      strOne = strOne +'</br>'+ str('{} : {}'.format(key, value))
      return HttpResponse(strOne)
# returns a print out of all your session variables in your browser
 
PREVIOUS NEXT
Tagged: #print #session #information #django
ADD COMMENT
Topic
Name
1+5 =