bugfix
This commit is contained in:
parent
d1d74f55d0
commit
5dda416a73
20
README.md
20
README.md
@ -1,2 +1,22 @@
|
|||||||
# example-server
|
# example-server
|
||||||
|
一个简单的web 服务器例子项目
|
||||||
|
|
||||||
|
## 依赖
|
||||||
|
* [bricks](https://git.opencomputing.cn/yumoqing/bricks.git)前端界面包
|
||||||
|
* [apppublic](https://git.opencomputing.cn/yumoqing/apppublic.git)python的基础工具包
|
||||||
|
* [sqlor](https://git.opencomputing.cn/yumoqing/sqlor.git)
|
||||||
|
* [ahserver](https://git.opencomputing.cn/yumoqing/ahserver.git)
|
||||||
|
* [bricks-for-python](https://git.opencomputing.cn/yumoqing/bricks-for-python.git)
|
||||||
|
|
||||||
|
## 安装
|
||||||
|
```
|
||||||
|
git clone https://git.opencomputing.cn/yumoqing/example-server.git
|
||||||
|
pip install apppublic sqlor ahserver bricks-for-python
|
||||||
|
```
|
||||||
|
|
||||||
|
## 启动服务
|
||||||
|
```
|
||||||
|
cd example-server
|
||||||
|
python app/example.py
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
from ahserver.serverenv import ServerEnv
|
from ahserver.serverenv import ServerEnv
|
||||||
from ahserver.webapp import webapp
|
from ahserver.webapp import webapp
|
||||||
|
from bricks_for_python.init import load_pybricks
|
||||||
|
|
||||||
def get_module_dbname(module_name):
|
def get_module_dbname(module_name):
|
||||||
return 'test'
|
return 'test'
|
||||||
@ -7,6 +8,7 @@ def get_module_dbname(module_name):
|
|||||||
def init():
|
def init():
|
||||||
env = ServerEnv()
|
env = ServerEnv()
|
||||||
env.get_module_dbname = get_module_dbname
|
env.get_module_dbname = get_module_dbname
|
||||||
|
load_pybricks()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
webapp(init)
|
webapp(init)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user