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

Tornado不可以自动重新加载吗?

  •  
  •   eraser · 2011-09-17 10:43:38 +08:00 · 6936 次点击
    这是一个创建于 4576 天前的主题,其中的信息可能已经有所发展或是发生改变。
    IDE用的是PyCharm 1.4.3,基于Tornado的一个项目,run以后修改的代码需要stop再run才可以生效,有没有自动重新加载的方法?
    就是达到GAE官方手册里提到的效果:
    as with the Python SDK—your app will be automatically re-built whenever you change the source.

    每次来回停止开始停止开始,蛋疼。。。好低效。。
    3 条回复    1970-01-01 08:00:00 +08:00
    zxp
        1
    zxp  
       2011-09-17 11:09:28 +08:00
    settings = {
    "debug": True,
    }

    app = tornado.web.Application([
    ('/', MainHandler),
    .....
    ], **settings)
    eraser
        2
    eraser  
    OP
       2011-09-17 11:24:58 +08:00
    @zxp 多谢! it works!!!
    Livid
        3
    Livid  
    MOD
       2011-09-17 12:09:25 +08:00
    如果是在 Linux 上,那么还可以将你的 Tornado 应用通过 supervisord 做成一个守护进程,这样只要刷浏览器就可以了,程序肯定会在后台被持续启动。

    在 Mac OS X 上的话,可以用 launchd。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3328 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:45 · PVG 21:45 · LAX 06:45 · JFK 09:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.