views.py 文件源码

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

项目:marvin-django 作者: programa-stic 项目源码 文件源码
def apk(request, app_id):
    myApp = get_object_or_404 (App, pk=app_id)
    #TODO: Cambiar por uno que te baje el APK
    filepath = apk_storage.get_filepath(myApp.package_name, myApp.md5)
    filesize = getsize(filepath)
    wrapper = FileWrapper(file(filepath))
    response = HttpResponse(wrapper, content_type = "application/vnd.android.package-archive")
    response ['Content-Disposition'] = 'attachment; filename="'+myApp.package_name+'.apk"'
    response ['Content-Length'] = filesize
    return response
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号