def index(request):
form = DownloadModForm(request.POST or None)
if form.is_valid():
cleaned_data = form.cleaned_data
zip_data = create_mod({
"top": cleaned_data["top"],
"right": cleaned_data["right"],
"bottom": cleaned_data["bottom"],
"left": cleaned_data["left"]
})
response = HttpResponse(zip_data, content_type="application/zip")
response["Content-Disposition"] = "attachment; filename=ui_reposition.zip"
response["Content-Length"] = len(zip_data)
return response
return render(request, "index.html", {
"version": VERSION,
"presets": SCREEN_PRESETS
})
评论列表
文章目录