An extension for Sanic that adds support for writing commands to your application.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8e53ed6 Nov 22, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example 0.1 Nov 22, 2017
sanic_script 0.1 Nov 22, 2017
.gitignore no message Nov 22, 2017
README.md 0.1 Nov 22, 2017
requirements.txt 0.1 Nov 22, 2017
setup.py 0.1 Nov 22, 2017

README.md

sanic-script

sanic-script is an extension for Sanic that adds support for writing external commands to your application.

sanic-script是Sanic框架的一个扩展库,为你的Web应用提供扩展命令支持。

install

$ pip install sanic-script

quick start

#!/usr/bin/python3
# -*- coding: utf-8 -*-

from runserver import app
from sanic_script import Manager

manager = Manager(app)

@manager.command
def hello():
    print("hello")

if __name__ == "__main__":
    manager.run()