繁体   English   中英

无法从VS2015向Azure Web App发布Django项目

[英]Unable to publish Django project to Azure Web App from VS2015

我在Visual Studio 2015中编写了一个Django项目,该项目在通过IDE进行调试时在本地服务器上成功运行。 但是,当我......

  1. 在Solution Explorer中右键单击该项目,然后选择Publish
  2. 选择Microsoft Azure Web Apps作为发布目标
  3. 单击新建...并输入详细信息以在Azure上创建新的Web应用程序:
    • 创建一个与Web App同名的新App Service Plan
    • 创建一个与Web App同名的新Resource Group
    • Region :北欧
    • Database server :无数据库
  4. 单击“ 创建”
  5. 选择发布方法: Web Deploy并成功验证与新Azure Web App的连接
  6. 单击“ 发布”

...“输出”窗口显示“发布”失败:

------ Publish started: Project: RaceLogger, Configuration: Debug Any CPU ------
Validating Web Deploy package/publish related properties...
Gather all files from Project items @(Content). Adding:
app\templates\app\performance_form.html;app\templates\auth\login.html;app\templates\index.html;app\templates\layout.html;app\templates\app\performance_detail.html;app\templates\app\performance_list.html;requirements.txt
Gather all files from Project output (IntermediateSatelliteAssembliesWithTargetPath). Adding:
Gather all files from Project items @(ReferenceCopyLocalPaths,ReferenceComWrappersToCopyLocal,ResolvedIsolatedComModules,_DeploymentLooseManifestFile,NativeReferenceFile).
Gather all files from Project items @(AllExtraReferenceFiles). Adding:
Gather all files from Project items @(_binDeployableAssemblies). Adding:
DjangoStaticUrlSetting=/static/
Regenerating web.config
Copying file from "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Python Tools\web_config.xml" to "obj\Debug\web.config".
Updating app settings in web.config
Made 1 replacement(s).
Updating rewrite conditions in web.config
Made 1 replacement(s).
Updating FastCGI handlers in web.config
Made 1 replacement(s).
Copying file from "obj\Debug\web.config" to "C:\Users\username\Documents\Files\Web_Projects\django\RaceLoggerProject\RaceLogger\web.config".
Regenerating web.debug.config
Copying file from "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Python Tools\web_debug_config.xml" to "obj\Debug\web.debug.config".
Updating ptvsd secret in web.debug.config
Made 1 replacement(s).
Copying file from "obj\Debug\web.debug.config" to "C:\Users\username\Documents\Files\Web_Projects\django\RaceLoggerProject\RaceLogger\web.debug.config".

========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

我已检查新创建的Azure Web App是否通过Azure管理门户运行并修改了Web App的Application settings以便选择Python版本3.4(在我的本地环境中,我运行的是Python 3.4.4和Django 1.9。 3)无济于事。 我已经尝试更新到VS2015 Update 2 RC,但这也没有区别。

我还尝试在Python 3.4.4 / Django 1.9.4虚拟环境中创建VS2015的New Project窗口中提供的示例Django Web Project ,但无法以完全相同的方式发布。

有没有人有任何关于如何从VS2015成功将Django项目发布到Azure Web App的建议?

任何援助将不胜感激。

您是否尝试使用虚拟环境来指定您的python版本,该版本不受Azure Web Apps Service上的Python版本的限制。

右键单击解决方案下的Python Environments部分,单击Add Virtual Environment

在此输入图像描述

选择python版本,选择下载并安装软件包 ,单击Create按钮在解决方案目录下创建新的虚拟环境。 在此输入图像描述

按F5进行调试以测试应用程序,然后再次尝试部署到Azure。

暂无
暂无

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

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