1 Star 0 Fork 43

flyger/baoaiback

forked from 源宝网络/baoaiback 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
manage.py 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
源宝网络 提交于 2020-04-05 09:35 . 更新项目版本命令
"""manage
BaoAI Backend Main File
PROJECT: BaoAI Backend
VERSION: 2.0.0
AUTHOR: henry <703264459@qq.com>
WEBSITE: http://www.baoai.co
COPYRIGHT: Copyright © 2016-2020 广州源宝网络有限公司 Guangzhou Yuanbao Network Co., Ltd. ( http://www.ybao.org )
LICENSE: Apache-2.0
"""
import os
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager, Shell, Server, Command
from flask_script.commands import Clean, ShowUrls
from app import *
# app,celery = create_app()
app = create_app()
manager = Manager(app)
migrate = Migrate(app, db)
def make_shell_context():
from app.modules.admin.model import Admin
return dict(app=app, db=db, Admin=Admin)
# Get BaoAI version and URL # 获取BaoAI版本及官方URL
@manager.command
def baoai():
print('BaoAI v%s - http://www.baoai.co'%__version__)
print('Desc\n%s'%__description__)
manager.add_command("runserver", Server(host='0.0.0.0', port=5000))
manager.add_command("shell", Shell(make_context=make_shell_context))
manager.add_command("db", MigrateCommand) # Database Manage # 数据库管理
manager.add_command("clean", Clean()) # Clean Cache File # 清理缓存文件
manager.add_command("url", ShowUrls()) # Print All URL # 打印所有URL
if __name__ == "__main__":
manager.run()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/flygervip/baoaiback.git
git@gitee.com:flygervip/baoaiback.git
flygervip
baoaiback
baoaiback
master

搜索帮助