簡體   English   中英

Azure Django部署失敗

[英]Azure Django deployment failure

我正在嘗試將Django Web應用程序部署到Azure應用程序服務。 我已經為該項目設置了一個帶有Github存儲庫的持續部署。

該項目在當地進行。 部署失敗,並顯示以下日志:

Command: deploy.cmd
Handling python deployment.
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Copying file: 'web.2.7.config'
Detected requirements.txt.
Creating  virtual environment.
The system cannot find the path specified.
An error has occurred during web site deployment.
The system cannot find the path specified.
The system cannot find the path specified.\r\nThe system cannot find the path specified.\r\nD:\Program Files(x86)\SiteExtensions\Kudu\61.60316.2745\bin\Scripts\starter.cmd deploy.cmd

我已經在項目根目錄級別包含以下部署文件:

.deployment, 
deploy.cmd, 
ptvs_virtualenv_proxy.py, 
requiremnts.txt, 
web.2.7.config

我嘗試從本地git倉庫部署項目。 其中返回了以下日志:

git push azure
Counting objects: 198, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (118/118), done.
Writing objects: 100% (198/198), 47.36 KiB | 0 bytes/s, done.
Total 198 (delta 94), reused 120 (delta 65)
remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id 'a68e71809f'.
remote: Running custom deployment command...
remote: Running deployment command...
remote: Handling python deployment.
remote: KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
remote: Copying file: '.gitignore'
remote: Copying file: 'db.sqlite3'
remote: Copying file: 'manage.py'
remote: Copying file: 'ptvs_virtualenv_proxy.py'
remote: Copying file: 'requirements.txt'
remote: Copying file: 'web.2.7.config'
remote: Copying file: 'accounts\admin.py'
remote: Copying file: 'accounts\apps.py'
remote: Copying file: 'accounts\backends.py'
remote: Copying file: 'accounts\forms.py'
remote: Copying file: 'accounts\models.py'
remote: Copying file: 'accounts\tests.py'
remote: Copying file: 'accounts\views.py'
remote: Copying file: 'accounts\__init__.py'
remote: Copying file: 'accounts\migrations\0001_initial.py'
remote: Copying file: 'accounts\migrations\__init__.py'
remote: Copying file: 'isi_django\settings.py'
remote: Copying file: 'isi_django\urls.py'
remote: Copying file: 'isi_django\wsgi.py'
remote: Copying file: 'isi_django\__init__.py'
remote: Copying file: 'isi_hours\admin.py'
remote: The system cannot find the path specified.
remote: Copying file: 'isi_hours\apps.py'
remote: The system cannot find the path specified.
remote: Copying file: 'isi_hours\forms.py'
remote: Copying file: 'isi_hours\models.py'
remote: Copying file: 'isi_hours\tests.py'
remote: Copying file: 'isi_hours\views.py'
remote: Copying file: 'isi_hours\__init__.py'
remote: Copying file: 'isi_hours\migrations\__init__.py'
remote: Copying file: 'static\css\home.css'
remote: Copying file: 'templates\base.html'
remote: Copying file: 'templates\datepicker.html'
remote: Copying file: 'templates\employee.html'
remote: Copying file: 'templates\empreport.html'
remote: Copying file: 'templates\home.html'
remote: Copying file: 'templates\index.html'
remote: Copying file: 'templates\login.html'
remote: Copying file: 'templates\logout.html'
remote: Copying file: 'templates\project.html'
remote: Copying file: 'templates\projreport.html'
remote: Copying file: 'templates\register.html'
remote: Detected requirements.txt.
remote: Creating  virtual environment.
remote: An error has occurred during web site deployment.
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.
To https://isireporting.scm.azurewebsites.net:443/isireporting.git
 * [new branch]      master -> master

這是由於部署未找到deploy.cmd文件導致的嗎? 還是部署文件配置不正確?

有關如何解決此問題的任何指示。

根據你的描述和錯誤信息,根據我的經驗,我認為這個問題可能由一些必需的Python包引起requirements.txt它不能直接支持Azure上的應用服務,其原因如下。

在Azure上運行時,某些軟件包可能無法使用pip安裝。 可能只是該軟件包在Python軟件包索引上不可用。 可能是需要編譯器(在Azure App Service中運行Web應用程序的計算機上沒有編譯器)。

請查看有關故障排除-軟件包安裝的詳細信息,以了解如何手動解決。

同時,我發現了您的另一個可能的問題。 web.2.7.config文件是Python 2.7的web.config模板文件。 如果您的項目不包含web.config文件,請復制web.2.7.config並重命名web.config ,然后按照上述同一文檔的Web.config部分檢查並配置部署以使其正常運行。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM