sort_order = ['site', 'A1', 'A5', 'A10']
allsites_ordered = [OrderedDict(sorted(iter(item.items()), key=lambda k_v:
    sort_order.index(k_v[0]))) for item in allsites]
data = {'Author': 'joe', 'data': allsites_ordered}
print(json.dumps(data, indent=4, separators=(',', ': ')))
How to custom-sort a list of dict to use in json.dumps