if 'mydata' in request.POST: data = json.loads(request.POST['mydata']) else: data = {} # or data = None