V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
jazdelu
V2EX  ›  Python

你们 django 写的应用的静态文件都存在哪里?

  •  
  •   jazdelu · 2014-02-26 09:39:02 +08:00 · 2992 次点击
    这是一个创建于 3714 天前的主题,其中的信息可能已经有所发展或是发生改变。
    主要是图片
    我想放在七牛但是这api看起来略烦。
    3 条回复    1970-01-01 08:00:00 +08:00
    yueyoum
        1
    yueyoum  
       2014-02-26 10:08:50 +08:00
    LZ 看看 https://github.com/yueyoum/seven-cow

    然后你就发现 原来使用起来这么简单
    mengzhuo
        2
    mengzhuo  
       2014-02-26 14:27:15 +08:00
    开发时丢在本地
    部署时用nginx
    glasslion
        3
    glasslion  
       2014-02-26 20:49:41 +08:00
    既然用了 Django ,静态文件相关的操作就全部交给 storage system 去做
    国外常见的存储平台基本上都有现成的第三方package时限好了

    七牛已经有了python SDK,自己实现一个django custom storage应该很容易。将来要迁移到别的平台也不用改代码.
    参考:
    https://docs.djangoproject.com/en/dev/howto/custom-file-storage/

    https://git.oschina.net/miao/django-upyun-storage/blob/master/django_upyun/storage.py
    https://github.com/ftao/django-upyun-storage/blob/master/upyunstorage/backends/upyun.py
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2641 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 15:40 · PVG 23:40 · LAX 08:40 · JFK 11:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.