www.cnblogs.com/ruiyqinrui

开源、架构、Linux C/C++/python AI BI 运维开发自动化运维。 春风桃李花 秋雨梧桐叶。“力尽不知热 但惜夏日长”。夏不惜,秋不获。@ruiY--秦瑞

python爬虫,C编程,嵌入式开发.hadoop大数据,桉树,onenebula云计算架构.linux运维及驱动开发.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

pip3 install fastapi # ASGI 服务:uvicorn: pip3 install uvicorn

from fastapi import FastAPI
import uvicorn
app = FastAPI()


@app.get("/{name}")
def read_root(name):
return {"Hello": "World, " + name}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
return {"item_id": item_id, "q": q}


if __name__ == '__main__':
uvicorn.run(app='img:app', host="127.0.0.1", port=8000, reload=True, debug=True)

 

 

 

 

 ERROR:    Error loading ASGI app. Could not import module "img".

源码文件名称不对原因

 

posted on 2021-06-09 17:42  秦瑞It行程实录  阅读(360)  评论(0)    收藏  举报
www.cnblogs.com/ruiyqinrui