Azure应用程序服务可以在嵌套文件夹中查找烧瓶应用程序。即使有枪支

发布于 2025-02-05 02:30:10 字数 512 浏览 3 评论 0原文

我有一个烧瓶应用程序,我可以在本地运行,问题是当我尝试用Azure运行它时,似乎无法找到该应用程序。我的文件树看起来像下面的一样,Azure从 /聊天机器人文件夹中开始。我需要进入 /chatbot_application /chatbot以访问app.py,

Chatbot 
├─── .vs
├───Chatbot_Application
│   └───Chatbot
│       ├───chatbot_backend
|       ├───app.py
|   ├─gunicorn.conf.py 

如果我运行这样的azure应用程序,我将没有代码输出,如果我将启动配置调整为此,

gunicorn --bind=0.0.0.0 --chdir /Chatbot_Application.Chatbot app:app

我会收到错误。聊天机器人”“无论我提出哪种格式。 我正在考虑走wsgi.py路线,但我认为我不会有任何运气,因为它将无法导入app.py模块。

I have a flask app which I'm able to run locally no problem, the issue is when I try to run it in Azure, it seems the app.py can't be found since I'm deploying with GitHub. My file tree looks something like below, and Azure starts in the /Chatbot folder. I need to get into /Chatbot_Application/Chatbot to access app.py

Chatbot 
├─── .vs
├───Chatbot_Application
│   └───Chatbot
│       ├───chatbot_backend
|       ├───app.py
|   ├─gunicorn.conf.py 

If I run the Azure app like this I get no code output, IF I adjust the start up configuration to this

gunicorn --bind=0.0.0.0 --chdir /Chatbot_Application.Chatbot app:app

I get an error "can't chdir to 'Chatbot_Application.Chatbot'" no matter what format I put.
I'm thinking of going the wsgi.py route but I don't think I'll get any luck because it won't be able to import the app.py modules.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自由范儿 2025-02-12 02:30:11

因此,该解决方案是为启动命令使用此格式。

gunicorn --bind=0.0.0.0 Chatbot_Application.Chatbot.app:app 

这将有助于Azure识别app.py,请记住我的应用程序中的模块称为应用程序,因此这就是为什么它的应用程序:应用程序。您必须解决问题“找不到模块”

So, the solution was using this format for the startup command.

gunicorn --bind=0.0.0.0 Chatbot_Application.Chatbot.app:app 

This will help Azure recognize the app.py, keep in mind the module within my app.py is called app so that's why it's app:app. You'll have to solve the issue 'cannot find module' ????

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文