from django import http
def test(request):
response = 'POST:
'
for k,v in request.POST.items():
response += '%s | %s |
' % (k, v)
response += '
'
response += 'Session:'
for k,v in request.session._session.items():
response += '%s | %s |
' % (k, v)
response += '
'
response += '''
'''
new_key = request.POST.get('new_key', False)
new_value = request.POST.get('new_value', False)
if new_key and new_value:
request.session[new_key] = new_value
return http.HttpResponse(response)