Django web app deploy in Azure via Visual Studio 2017

后端 未结 2 839
甜味超标
甜味超标 2021-01-24 11:22

I\'ve made a simple app with Django in Visual Studio 2017, utilizing the default template in Visual Studio (file - new - project - python - django web application). The app runs

相关标签:
2条回答
  • 2021-01-24 12:21

    In consideration of using Visual Studio to create & deploy a Django App for Azure, I suggest that you can follow the Azure offical tutorial Django and MySQL on Azure with Python Tools 2.2 for Visual Studio to inspect & make sure your steps correctly.

    There are some checkpoints as below.

    1. Make sure PTVS installed correctly, please move to here to know more details of PTVS.
    2. Create a virtual environment for a Python version like 2.7 via PTVS.
    3. Edit the requirements.txt file of your project, and make sure there is a record for Django like Django==1.11.2.
    4. When you want to deploy it to Azure WebApps, please check the Python version for Azure WebApps that is the same with your project.
    5. If your Django App doesn't still work as you want, please refer to the document to check the configuration of the web.config file via access the Kudu tool https://<your app name>.scm.azurewebsites.net and other troubleshooting content, and refer to the document to check the application settings on Azure portal.

    Hope it helps. Any concern, please feel free to let me know.

    0 讨论(0)
  • 2021-01-24 12:24

    After much struggle i manage to to do it!

    I will explain how i did it (i've used many tutorials and forum posts answers to achieve this):

    1) I've created a Django (PTVS) Web App in Azure;

    2) Followed this tutorial to configure that app;

    3) Make the necessary adjustments to web.config file in my project, notably the path to the python version installed via extension;

    4) Published my project via Visual Studio 2017 to that Django App created in the first step.

    And it worked!

    0 讨论(0)
提交回复
热议问题