在Python中使用API创buildGoogle Cloud Function
我正在使用Python(3.6)和Django(1.10)开发一个项目,在这个项目中我需要使用API请求在Google云端创build一个函数。 如何在创build该函数的同时以zip压缩文件的forms上传代码? 以下是我所尝试的: 来自views.py: def post(self, request, *args, **kwargs): if request.method == 'POST': post_data = request.POST.copy() post_data.update({'user': request.user.pk}) form = forms.SlsForm(post_data, request.FILES) print('get post request') if form.is_valid(): func_obj = form func_obj.user = request.user func_obj.project = form.cleaned_data['project'] func_obj.fname = form.cleaned_data['fname'] func_obj.fmemory = form.cleaned_data['fmemory'] func_obj.entryPoint = form.cleaned_data['entryPoint'] func_obj.sourceFile = form.cleaned_data['sourceFile'] func_obj.sc_github = form.cleaned_data['sc_github'] func_obj.sc_inline_index = form.cleaned_data['sc_inline_index'] func_obj.sc_inline_package […]