Crie o arquivo JSON vazio Python

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