繁体   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