https://github.com/38elements/sanic-admin
sanic-admin is a command line tool for automatically restarting sanic.
https://github.com/38elements/sanic-admin
reload restart sanic
Last synced: 5 months ago
JSON representation
sanic-admin is a command line tool for automatically restarting sanic.
- Host: GitHub
- URL: https://github.com/38elements/sanic-admin
- Owner: 38elements
- License: mit
- Created: 2017-02-19T02:06:03.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-25T08:46:33.000Z (about 8 years ago)
- Last Synced: 2024-09-18T01:17:32.091Z (7 months ago)
- Topics: reload, restart, sanic
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 15
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sanic-admin
`sanic-admin` is a command line tool for automatically restarting [sanic](https://github.com/channelcat/sanic).
The code(*.py) under the current working directory is changed, `sanic` will automatically restart.## Installation
```
pip install sanic-admin
```## Usage
#### Auto reload
```
sanic-admin server.py
```#### Display urls
```
sanic-admin -urls server.py
```## Setting
You can change the behavior of `sanic-admin` by putting a file named` sanic-admin.json` in current working directory like the contents below.
```
{
// Patterns of filename to be watched
// default ["*.py"]
"patterns": ["*.html", "*.css", "*.py"],
// Paths to be watched
// default current working directory
"paths": ["/foo1/bar1", "/foo2/bar2"],
// File to be executed when sanic-admin starts
// default None
"before": "before.py",
// File to be executed before sanic restarts
// default None
"before_each": "before_each.py",
// File to be executed when sanic-admin exits
// default None
"after": "after.py",
// File to be executed after sanic restarts
// default None
"after_each": "after_each.py",
// Variable name of sanic instance
// default "app"
"app": "app"
}
```