繁体   English   中英

当我将Django应用程序部署到Azure Web应用程序服务时,Requirements.txt导致错误

[英]Requirements.txt causes an error when I'm deploying my Django app to the Azure web app service

我在Azure Web应用程序服务上托管了一个Django应用程序。 我最近删除了skipPythonDeployment文件,以便可以从我的requirements.txt文件中添加自定义包。 起初,当我仅添加酥脆的表格包时,此方法效果很好。 但是之后,我想将Django安装更新为1.11(应用程序服务中的默认版本为1.9.4)。

因此,这是我的requirements.txt当前的外观:

django<2
django-crispy-forms==1.6.1

现在,当我尝试将提交推送到服务器( git push azure master )时,我得到以下部署日志:

Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 308 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 1 (delta 0)
remote: Updating branch 'master'.
remote: .............................................
remote: Updating submodules.
remote: Preparing deployment for commit id '763167dc3c'.
remote: Generating deployment script.
remote: Running deployment command...
remote: Handling python deployment.
remote: Detected requirements.txt.  You can skip Python specific steps 
with a .skipPythonDeployment file.
remote: Detecting Python runtime from site configuration
remote: Detected python-2.7
remote: Found compatible virtual environment.
remote: Pip install requirements.
remote: An error has occurred during web site deployment.
remote: 
remote: Error - Changes committed to remote repository but deployment to website failed.
To https://username@project.scm.azurewebsites.net:443/b

我尝试查看Azure提交日志,但错误几乎相同:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling python deployment.
Detected requirements.txt.  You can skip Python specific steps with a 
.skipPythonDeployment file.
Detecting Python runtime from site configuration
Detected python-2.7
Found compatible virtual environment.
Pip install requirements.
An error has occurred during web site deployment.
\r\nD:\Program Files 
(x86)\SiteExtensions\Kudu\65.60816.2969\bin\Scripts\starter.cmd 
"D:\home\site\deployments\tools\deploy.cmd"

知道我在做什么错吗? 或者在哪里可以看到实际的错误?

编辑

这个github线程( https://github.com/azureappserviceoss/DjangoAzure/issues/2 )提供了一种解决方法,方法是从服务器中删除env / azure.env.python-2.7.txt,但没有解释错误的原因发生。

这很可能是一些点错误。 在Azure中,您可以在“部署选项”刀片上看到pip日志输出。 (您可能需要将Web应用程序配置为跟踪git分支,如果尚未同步,则自动与其同步。)如果最近的部署失败,您会看到一个红色的感叹号; 单击该部署,然后单击部署命令旁边的“查看日志”。 这将使您看到pip输出以及出了什么问题。

如果您访问FTP站点,还可以访问应用程序服务器上的pip日志。

Azure部署步骤

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM