[Python] [Web Apps]从github部署时,Python \Flask App无法运行 [英] [Python][Web Apps] Python\Flask App doesnt work when deployed from github

查看:115
本文介绍了[Python] [Web Apps]从github部署时,Python \Flask App无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

添加不多,tbh。当我从Visual Studio部署它时,它确实有效,但是当我从GitHub设置部署时它不起作用。它确实已经部署,但是我觉得有些东西是路径混乱的。这是有问题的应用程序https:/ /github.com/4c74356b41/pyflare

Not much to add, tbh. When I deploy it from Visual Studio it does work, but doesn't work when I setup deploy from GitHub. It does get deployed, but something's messy with pathing, I guess. Here's the app in question https://github.com/4c74356b41/pyflare

提前致谢!

此文本上方的数据为伪随机数,大括号你自己。

The data above this text is pseudorandom, brace yourselves.

推荐答案

根据您的Github存储库,它是一个完整的VS解决方案目录,而不是您的python应用程序的根目录。

According your Github repository, it's an entire VS solution directory, not the root directory of your python application.

通常,当我们利用git或github将应用程序部署到Azure Web Apps时,我们会将根目录中的所有内容存储到存储库中。如果以下两个条件都成立,Azure将确定您的应用程序使用Python:

Usually, when we leverage git or github to deploy the applications to Azure Web Apps, we will store the all contents in root directory into the repository. And Azure will determine that your application uses Python if both of these conditions are true:


  •  根文件夹中的requirements.txt文件
  • 根文件夹中的任何.py文件或指定python的runtime.txt

您可以参考  https://azure.microsoft.com/en-us/documentation/articles/web- sites-python-configure /#git-publishing  更多
详细信息。

You can refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-configure/#git-publishing for more details.

同时,您可以在应用设置中定义配置您的Azure Web应用程序: DEPLOYMENT_SOURCE 到存储库中应用程序根目录的路径,例如"AccountingWebApp"和"AccountingWebApp"。在您的问题中。 

Meanwhile, you can define the configuration in app settings of your Azure Web Apps: DEPLOYMENT_SOURCE to the path of app's root directory in your repository, like "AccountingWebApp" here in your issue. 


这篇关于[Python] [Web Apps]从github部署时,Python \Flask App无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆