@api_endpoint
@ajax_request
@login_required
def sign_policy_document(request):
    policy_document = json.loads(request.body)
    policy = base64.b64encode(json.dumps(policy_document))
    signature = base64.b64encode(
        hmac.new(
            settings.AWS_UPLOAD_CLIENT_SECRET_KEY, policy, hashlib.sha1
        ).digest()
    )
    return {
        'policy': policy,
        'signature': signature
    }
Sign and return the policy doucument for a simple upload.
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/data_importer/views.py/sign_policy_document