腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
未
执行
FastAPI
main
python
、
main
、
rest
、
execution
、
fastapi
from
fastapi
import
FastAPI
def indexlocal_database.append(dummy_person1) populate_database
浏览 38
提问于2021-08-15
得票数 1
回答已采纳
3
回答
在模块"
main
“中找不到属性"app”
python
、
fastapi
我安装了
FASTAPI
,并且正在运行下面提到的代码from
fastapi
import
FastAPI
def read_root():‘并且我在
执行
文件时在控制台中得到下面提到的错误’ (venv) D:\
FASTAPI
>uvicorn
main
:app --
浏览 90
提问于2021-11-13
得票数 0
1
回答
禁用快速from microsoft标识中的requires_auth装饰器
python
、
azure-active-directory
、
mocking
、
fastapi
、
python-unittest
requires_auth(*args, **kwargs): return requires_auth except AuthError as ae: return
fastapi
.Response(
浏览 0
提问于2022-08-30
得票数 0
1
回答
使用python构建的
FastAPI
服务器在长时间空闲后会卡住
python
、
rest
、
fastapi
我正在使用Python通过
FastAPI
构建REST API服务,在我启动该服务并稍后返回后,API端点停止响应。最后,我返回到正在运行的API命令行窗口,按下Ctrl+C停止API服务器。就在那时,API继续响应并
执行
工作,显示它通过我在上一步中完成的URL接收到了GET请求。from
fast
浏览 8
提问于2021-09-06
得票数 0
1
回答
无法在Spyder中
执行
FastAPI
客户端代码
python
、
python-asyncio
、
spyder
、
fastapi
、
uvicorn
在Spyder环境中尝试开发
FastAPI
客户端时,无法启动
执行
。代码失败并引发:from
fastapi
import
FastAPI
async def root(): return {"message": "Hello W
浏览 36
提问于2021-11-26
得票数 2
1
回答
"RuntimeError:在
执行
另一个任务时不能进入任务“,仅在第一次使用
FastAPI
调用API之后才出现。
python
、
python-asyncio
、
fastapi
、
nest-asyncio
我使用的是
FastAPI
,奇怪的是,只有在第一个API调用时,我才得到错误"RuntimeError:无法在
执行
另一个任务时进入任务“。我提供了一些示例代码,这些代码应该重现此错误。import asynciofrom
fastapi
import
FastAPI
nest_asyncio.apply() async def t
浏览 19
提问于2022-07-28
得票数 0
3
回答
如何使用Pycharm运行快速api服务器?
python
、
pycharm
、
fastapi
我有一个简单的API函数如下, async def read_root():return {"Hello": "World"}uvicorn
main
:app 因为我们没有直接调用任何python文件,所以不可能从Pycharm调用uvicorn
浏览 5
提问于2020-07-12
得票数 70
回答已采纳
1
回答
FastAPI
初始化的调用次数把我搞糊涂了
python
、
python-3.x
、
fastapi
、
uvicorn
例如,让我们以简单的
FastAPI
应用程序为例: import uvicornasync def test(): u
浏览 101
提问于2020-10-02
得票数 0
回答已采纳
1
回答
RuntimeError:
FastAPI
内存不足
python
、
pytorch
、
fastapi
from api.routes import filtered_images但是,如果没有在一个python代码中
执行
,并将其分为两个,并按顺序
执行
,则不会出现错误。app.include_router(detected_images.ro
浏览 23
提问于2022-03-11
得票数 0
1
回答
Uvicorm -
Fastapi
- "asyncio.run()不能从运行中的事件循环中调用“,当将应用程序部署到docker时
docker
、
fastapi
、
uvicorn
())return self.
main
(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in
ma
浏览 8
提问于2022-09-01
得票数 0
1
回答
如何在运行ModuleNotFoundError服务器时修复“
FastAPI
:没有名为'app‘的模块?”
python-3.x
、
environment-variables
、
fastapi
、
python-poetry
我在
FastAPI
中使用环境变量,但是在使用uvicorn
main
:app --reload运行服务器时,我得到了一个"ModuleNotFoundError“错误 return loop.run_until_complete(
main
/
main
.py"
浏览 7
提问于2022-03-09
得票数 1
回答已采纳
1
回答
如何在本地主机上使用Fast加载index.html文件?
html
、
static
、
fastapi
return templates.TemplateResponse("index.html", context= {"request": request}) 在这两种情况下,我无法使用:from
fastapi
.staticfiles似乎from
fastapi
import
FastAPI
也无法被解析,但是在我尝试加载html文件之前,这并没有阻止程序工作,
浏览 6
提问于2022-09-20
得票数 0
回答已采纳
1
回答
FastAPI
python:如何在后台运行线程?
python
、
multithreading
、
fastapi
、
uvicorn
我正在使用
FastAPI
在python中创建一个服务器,我希望一个与我的API无关的函数每5分钟在后台运行一次(比如检查API中的内容并根据响应打印内容)。def start_worker(): my_worker.working_loop() # this function prints "hello" every 5 seconds if __name__ == '__
main<
浏览 63
提问于2022-01-27
得票数 4
回答已采纳
1
回答
与
FastAPI
一起使用时无法识别的CSS
python
、
http-status-code-404
、
fastapi
我已经构建了一个
FastAPI
应用程序和一个索引、css和js文件,这些文件在直接打开时可以工作,但是我无法在
FastAPI
服务时显示这个css文件。这里是我的目录:└── app ├── style.css应用程序的主页路径设置如下: file_path到目前为止,我尝试过的格式还没有起作用,例如,有关
FastAPI
的错误并没有像用Flask或Django那样被很好地记录下来。
浏览 2
提问于2020-05-06
得票数 10
2
回答
如何从终端运行
FastAPI
?
python
、
shell
、
fastapi
我想在shell中
执行
fastapi
。python manage.py shell 如何在
fastapi
中
执行
此操作?
浏览 2
提问于2020-10-07
得票数 3
1
回答
更改由OpenAPI生成的
FastAPI
文档中的模式名称
python
、
openapi
、
fastapi
、
pydantic
我正在使用
FastAPI
为我的项目创建后端。我有一个允许上传文件的方法。我将其具体实施如下: from app.models.schemas.files import FileInResponse
浏览 7
提问于2022-01-14
得票数 0
2
回答
导入字符串"
main
“必须格式为"<module>:<attribute>”
fastapi
、
uvicorn
、
asgi
尝试使用uvicorn测试我的第一个
FastAPI
应用程序。以下代码是在朱庇特笔记本上编写的,并保存为目录中的'
main
.py':/home/userasync def root():来自我正在运行的
浏览 15
提问于2022-02-08
得票数 1
1
回答
是否可以在命令行中运行
fastapi
?
python
、
fastapi
我们可以在python中运行任何脚本来
执行
以下操作: python
main
.py 如果脚本是
FastApi
应用程序,是否可以
执行
相同的操作?类似于: python
main
.py GET /login.html 调用返回login.html页的GET方法。如果没有,我如何在不使用Uvicorn或其他how服务器的情况下启动
FastApi
应用程序? 我想只有在必要的时候才能运行脚本。 谢谢
浏览 37
提问于2021-06-16
得票数 0
2
回答
最小
FastAPI
静态文件服务器脚本
fastapi
、
starlette
我想编写一个从脚本启动的最小
FastAPI
静态文件服务器,该脚本允许您指定要在命令行上共享的目录。在之后,我写了这个。import uvicornfrom
fastapi
.staticfiles import StaticFiles import sys directory = sys.argv[1
浏览 14
提问于2022-11-23
得票数 0
回答已采纳
1
回答
Uvicorn服务器不在windows的终端中工作。
python
、
fastapi
(
fastapi
) E:\Python Practice\
FastAPI
\
fastapi
\
fastapi
>uvicorn
main
:app --reload INFO: UvicornCould not imp
浏览 8
提问于2022-06-15
得票数 -1
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
干货|单片机main函数在中断函数里执行?
使用 Python FastAPI 构建 Web 服务
C语言程序员编程学习,退出main函数后还能执行的代码吗?
通过 Python FastAPI 开发一个快速的 Web API 项目
Python 快速搭建 RESTful API
热门
标签
更多标签
活动推荐
运营活动
广告
关闭
领券