项目作者: 38elements

项目描述 :
sanic-admin is a command line tool for automatically restarting sanic.
高级语言: Python
项目地址: git://github.com/38elements/sanic-admin.git
创建时间: 2017-02-19T02:06:03Z
项目社区:https://github.com/38elements/sanic-admin

开源协议:MIT License

下载


sanic-admin

sanic-admin is a command line tool for automatically restarting sanic.
The code(*.py) under the current working directory is changed, sanic will automatically restart.

Installation

  1. pip install sanic-admin

Usage

Auto reload

  1. sanic-admin server.py

Display urls

  1. sanic-admin -urls server.py

Setting

You can change the behavior of sanic-admin by putting a file namedsanic-admin.json in current working directory like the contents below.

  1. {
  2. // Patterns of filename to be watched
  3. // default ["*.py"]
  4. "patterns": ["*.html", "*.css", "*.py"],
  5. // Paths to be watched
  6. // default current working directory
  7. "paths": ["/foo1/bar1", "/foo2/bar2"],
  8. // File to be executed when sanic-admin starts
  9. // default None
  10. "before": "before.py",
  11. // File to be executed before sanic restarts
  12. // default None
  13. "before_each": "before_each.py",
  14. // File to be executed when sanic-admin exits
  15. // default None
  16. "after": "after.py",
  17. // File to be executed after sanic restarts
  18. // default None
  19. "after_each": "after_each.py",
  20. // Variable name of sanic instance
  21. // default "app"
  22. "app": "app"
  23. }