推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
RangerWolf
V2EX  ›  Python

SAE storage + Django 上传文件只能 2.5MB?

  •  
  •   RangerWolf · Oct 23, 2014 · 3825 views
    This topic created in 4363 days ago, the information mentioned may be changed or developed.
    官网虽然贴了一个大文件上传的文档链接,但是打开了完全看不到相关内容。难道大文件(>2.5MB)就只能通过客户端上传了吗?

    暂时只想到一个办法就是修改Django默认的2.5MB限制,比如修改到50MB
    不过如果使用这种办法,会不会造成服务器内存使用太多,从而如果多人使用会严重影响性能?

    当然另外一个方法就是放到自己的VPS了

    第一次搞这方面的东西,没啥经验,请大家帮忙出出主意~
    1 replies  •  2014-10-23 13:01:50 +08:00
    glasslion
        1
    glasslion  
       Oct 23, 2014   ❤️ 1
    https://docs.djangoproject.com/en/dev/topics/http/file-uploads/#upload-handlers

    自己写个 Fileuploader 呗, Django 大文件默认是上传到/tmp (https://github.com/django/django/blob/731f313d604a6cc141f36d8a1ba9a75790c70154/django/core/files/uploadhandler.py)

    虽然SAE没给/tmp的权限,但提供了一个 `sae.core.get_tmp_dir()` 的API
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2311 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 07:03 · PVG 15:03 · LAX 00:03 · JFK 03:03
    ♥ Do have faith in what you're doing.