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
arzon
V2EX  ›  Python

大家都是怎么部署python项目的

  •  
  •   arzon · 2011-12-07 20:48:28 +08:00 · 9181 次点击
    这是一个创建于 4525 天前的主题,其中的信息可能已经有所发展或是发生改变。
    一直都困惑于python项目的部署方式,

    在更新代码后只能重启应用服务器, 不知道有没有更好的方式

    比如自动感知修改并reload或者说热部署(类似于PHP或JSP)

    如果只能重启的话, 有没有比较好的自动化实现这个过程的方式?

    大家都来贴下自己的部署方式吧, 互相交流促进.
    18 条回复    1970-01-01 08:00:00 +08:00
    aligo
        1
    aligo  
       2011-12-07 20:54:00 +08:00
    不是有fabric吗。。。
    clino
        2
    clino  
       2011-12-07 22:19:59 +08:00
    uliweb 的开发服务器能自动检测修改
    不过实际的服务器我也只有重启了,我是菜鸟一只
    arzon
        3
    arzon  
    OP
       2011-12-08 10:44:49 +08:00
    呃, 怎么没有多少人愿意来交流.

    难道用于商业的python项目真的很少吗
    lijia18
        4
    lijia18  
       2011-12-08 11:00:55 +08:00
    这个ci之后重启就是了,难道你会频繁的改上线网站的代码吗?
    clino
        5
    clino  
       2011-12-08 11:03:35 +08:00
    况且自动检测有时候不可靠,如果是我是不太敢用在实际的环境下的
    spritevan
        6
    spritevan  
       2011-12-08 11:31:13 +08:00
    supervisorctl restart app
    Livid
        7
    Livid  
    MOD
       2011-12-08 11:33:30 +08:00
    V2EX 的所有 Tornado 项目都配合 supervisord 控制自动启动。
    SErHo
        8
    SErHo  
       2011-12-08 13:08:23 +08:00
    Instagram 架构分析笔记 http://www.dbanotes.net/arch/instagram.html
    其中提到了Fabric。
    est
        9
    est  
       2011-12-08 13:30:16 +08:00
    uwsgi touch-reload
    gfcheng
        10
    gfcheng  
       2011-12-10 00:37:57 +08:00
    关注下这个
    自己是git push 网站代码到vps,在SFTP传静态文件上去,再连SSH去重启uWSGI,超烦
    aveline
        11
    aveline  
       2011-12-10 00:43:42 +08:00
    @gfcheng 用bitbucket的路过,添加了个post service,每次push完之后会调用。然后就服务器更新。。。更新完之后gtalk发送结果。
    gfcheng
        12
    gfcheng  
       2011-12-10 12:43:46 +08:00
    @aveline
    bitbucket 的POST service 怎么填URL,求方法
    我在服务器端有git --bare init,本地PUSH到这个源,再由它post-update去更新另一个目录的网站代码
    bitbucket怎么参一脚呢
    lepture
        13
    lepture  
       2011-12-10 12:54:28 +08:00
    @gfcheng http://confluence.atlassian.com/display/BITBUCKET/Setting+Up+the+Bitbucket+POST+Service

    代碼提交到 bitbucket ,bitbucket 向你的server發起post request, server接收到信號,server去bitbucket pull代碼, server 更新代碼並且reload
    fcicq
        14
    fcicq  
       2011-12-10 12:59:48 +08:00
    gunicorn, kill -HUP `cat xxxxx.pid`
    fanzeyi
        15
    fanzeyi  
       2011-12-10 13:04:20 +08:00
    @@ 我直接 python /path/to/web 2>&1 > /path/to/logs & 了..
    gfcheng
        16
    gfcheng  
       2011-12-10 13:19:39 +08:00
    @lepture
    明白了
    要自己去写视图函数接收request,我有够弱的
    kingwkb
        17
    kingwkb  
       2011-12-10 13:24:16 +08:00
    @est uwsgi的touch-reload如何使用?
    Kenyth
        18
    Kenyth  
       2011-12-10 13:57:30 +08:00 via iPad
    Touch .wsgi and it automatically get reloaded, not actually affecting your server.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5858 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 64ms · UTC 06:17 · PVG 14:17 · LAX 23:17 · JFK 02:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.