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

问题描述:

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

I have a existing django web application currently deployed on aws. I want to deploy it on Microsoft Azure by using cloud services. How to create config files for deploying web app on Azure? How to access environment variables on Azure? I am not using Visual Studio. I am developing web app in linux env and using git for code management. Please help

听起来您想知道哪种方法是通过Git部署Django应用进行代码管理的最佳选择在Linux上,使用Cloud Services或Azure上的App Services。

It sounds like you want to know which way is the best choice for deploying a django app via Git for code management on Linux, using Cloud Services or App Services on Azure.

根据我的经验,我认为通过Linux上的Git将纯净的Web应用程序部署到Azure上的App Service是最简单的你的方式。您可以参考下面的官方文档以了解如何通过Azure CLI或仅通过Git进行操作。

Per my experience, I think deploying a pure web app into App Service on Azure via Git on Linux is the simplest way for you. You can refer to the offical docuemnts below to know how to do it via Azure CLI or only Git.


  1. 在五分钟内将第一个Python Web应用程序部署到Azure

  2. 将本地Git部署到Azure应用服务

  1. Deploy your first Python web app to Azure in five minutes
  2. Local Git Deployment to Azure App Service

其中有一个代码 sample 作为参考,您可以知道如何配置它以便在Azure上运行。

And there is a code sample of Django on App Service as reference that you can know how to configure it for running on Azure.

但是,如果您的应用需要更强大的功能,性能,将django应用程序使用云服务也比直接使用VM更好。另外作为参考,请查看文档 Python网站和适用于Visual Studio的Python工具的工作人员角色,以了解如何让Azure支持Python& Django on Cloud Services,您可以创建&在Linux上的浏览器中通过Azure门户进行部署。同时,感谢Django WebRole Cloud Service的第三方GitHub示例请参阅了解如何在Linux上不使用PTVS for VS的情况下创建云服务项目结构。

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.

希望它会有所帮助。