如何在Microsoft Azure云服务上部署Django Web应用程序

Man*_*ngh 6 python git deployment django azure

我有一个现有的Django Web应用程序,当前已部署在AWS上。我想通过使用云服务将其部署在Microsoft Azure上。如何创建配置文件以在Azure上部署Web应用程序?如何在Azure上访问环境变量?我没有使用Visual Studio。我正在linux env中开发Web应用程序,并使用git进行代码管理。请帮忙

Pet*_*Pan 3

听起来您想知道哪种方式是通过 Git 部署 django 应用程序以在 Linux 上进行代码管理、使用云服务或 Azure 上的应用程序服务的最佳选择。

根据我的经验,我认为通过 Linux 上的 Git 将纯 Web 应用程序部署到 Azure 上的应用程序服务中是最简单的方法。您可以参考下面的官方文档来了解如何通过 Azure CLI 或仅使用 Git 来完成此操作。

  1. 五分钟内将您的第一个 Python Web 应用程序部署到 Azure
  2. 本地 Git 部署到 Azure 应用服务

并且有一个 Django on App Service 的代码示例作为参考,您可以了解如何配置它以在 Azure 上运行。

However, if your app need more powerful features & performance, using Cloud Services for your django app is also a better way than using VM directly. Also as references, please view the document Python web and worker roles with Python Tools for Visual Studio to know how to let Azure support Python & Django on Cloud Services, and you can create & deploy it via Azure portal in the browser on Linux. Meanwhile, thanks for the third party GitHub sample of Django WebRole for Cloud Service which you can refer to know how to create a cloud service project structure without PTVS for VS on Linux.

Hope it helps.