我有一個託管在Azure Web應用程序服務上的Django應用程序。我最近刪除了skipPythonDeployment
文件,以便我可以從我的requirements.txt文件添加自定義軟件包。起初,這工作得很好,當我添加了脆皮表單包,但之後我想更新我的Django安裝到1.11(應用程序服務的默認版本是1.9.4)。當我將Django應用程序部署到Azure Web應用程序服務時,Requirements.txt會導致錯誤
所以這是我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://[email protected]: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,但它並不能解釋爲什麼錯誤發生。