def add_script_project(request):
name = request.POST['name']
desc = request.POST['description']
entrance = request.POST['entrance']
arguments = request.POST['arguments']
sp = ScriptProject(name=name, desc=desc, entrance_point=entrance, arguments=arguments)
sp.save()
project_path = os.path.join(SCRIPT_MANAGER_DIR, '%s_%s' % (str(sp.id), canonize_project_name(name)))
if not os.path.exists(project_path):
os.makedirs(project_path)
for file_ in request.FILES.getlist('files[]'):
path = default_storage.save(os.path.join(project_path, file_.name), ContentFile(file_.read()))
return HttpResponse()
评论列表
文章目录