首页 文章

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

提问于
浏览
3

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

  • 在解决方案资源管理器中右键单击项目,然后选择 Publish

  • 选择 Microsoft Azure Web Apps 作为发布目标

  • 单击 New... 并输入详细信息以在Azure上创建新的Web应用程序:

  • 创建一个与Web App同名的新 App Service Plan

  • 创建一个与Web App同名的新 Resource Group

  • Region :北欧

  • Database server :没有数据库

  • 点击 Create

  • 选择发布方法: Web Deploy 并成功 Validate Connection 到新的Azure Web App

  • 点击 Publish

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

------ 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 ==========

我've checked that the newly created Azure Web App is running via the Azure Management Portal and have modified the Web App' s Application settings 以便选择Python版本3.4(在我的本地环境中,我_804402已尝试更新到VS2015 Update 2 RC,但这也没有区别 .

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

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

任何援助将不胜感激 .

1 回答

  • 1

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

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

    enter image description here

    选择python版本,选择下载并安装软件包,单击 Create 按钮在解决方案目录下创建新的虚拟环境 .
    enter image description here

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

相关问题