question

Gilang-7284 avatar image
1 Vote"
Gilang-7284 asked AnnaManzoni-2374 answered

Django app deployed on Azure app services not appearing

I tried to deploy a Django application using Azure App Services. To be more specific, I followed this tutorial, with some additional features I added to the application.

However, when I tried to open the application by your-azure-project.azurewebsites.net, the "Hey, Python developers!" page keeps appearing instructing me to deploy my application. Of course, I replaced your-azure-project with my real project name; and I also tried to redeploy my application. In the end, the result didn't change at all.

2451-anotasi-2020-01-26-133057.png

I am still new with the Azure platform, so I was wondering if anybody could point out what I was missing? Thanks in advance.


azure-webapps-content-deploymentazure-webapps-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered

Welcome to Microsoft Q&A! Thanks for posting the question.

If the App Service doesn't find a custom command, a Django app runs a default read-only app, located in the opt/defaultsite folder. You can control the container's startup behavior by providing a custom Gunicorn startup command. To do this, kindly take a look into this document for detailed steps.
-App Service looks for a file named wsgi.py within your app code, and then runs Gunicorn.

App Service ignores any errors that occur when processing a custom command file, then continues its startup process by looking for Django and Flask apps. Also, kindly review the startup file is deployed to App Service and that it doesn't contain any errors.

Note that the Python extensions for App Service on Windows is deprecated in favor of a direct deployment to App Service on Linux. So, leverage App Service for Linux rather than a Windows-based instance. Also, ensure that the Python module is correctly set requirement.txt and include below line of code as first line in requirements.txt file “ --find-links wheelhouse”.

Kindly let us know how it goes for further investigation.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HowardPaggerton-1455 avatar image
2 Votes"
HowardPaggerton-1455 answered

Basically if the log stream shows "Could not find setup.py or requirements.txt; Not running pip install." it means that the Oryx build process failed to find your requirements.txt file you can connect to the web app's container via SSH and verify that requirements.txt is named correctly and exists directly under site/wwwroot. If it doesn't exist, make site the file exists in your repository and is included in your deployment. If it exists in a separate folder, move it to the root.

Here is the Azure reference, plus I recommend to check up with some Django tutorials.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AnnaManzoni-2374 avatar image
0 Votes"
AnnaManzoni-2374 answered

You can try to follow this manual:

  • The log stream shows "Could not find setup.py or requirements .txt; Not running pip install.": The Oryx build process failed to find your requirements .txt file.

  • Connect to the web app's container via SSH and verify that requirements .txt is named correctly and exists directly under site/wwwroot. If it doesn't exist, make site the file exists in your repository and is included in your deployment. If it exists in a separate folder, move it to the root.

In general, that article describes how Azure App Service runs Python apps, in particular Django timefield, and how you can migrate existing apps to Azure, and customize the behavior of App Service when needed. Python apps must be deployed with all the required pip modules.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.