views.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:starbound-ui-reposition 作者: Matoking 项目源码 文件源码
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
    })
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号