Skip to content Skip to sidebar Skip to footer

Django-based Azure Web App Getting Stuck When Development Server Is Run (on Kudu)

To migrate an app from Heroku to Azure, I recently created a Django Azure Web App, connected it to my GitHub account and pushed my existing app code onto it via git push azure mast

Solution 1:

Running a Django app as an Web App should be fine. Documentation suggests setting up a virtualenv for the app, see https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-create-deploy-django-app/#web-app-development---maclinux---command-line

Web.config is unnecessary unless you need to use HttpPlatformHandler. If you have initiation needs see http://www.iis.net/learn/extensions/httpplatformhandler/httpplatformhandler-configuration-reference.

Each Web App is assigned a port number that is bound the HTTP_PLATFORM_PORT environment variable. App Service will terminate incoming requests and forward them to the specified port. If Web App for some reason doesn't run the Django app you can explicitly tell HttpPlatformHandler how to execute the app, e.g. by writing a batch-file that runs python manage.py runserver 0.0.0.0:%HTTP_PLATFORM_PORT% and have HttpPlatformHandler execute the file.

Solution 2:

You won't be able to run the development server since it needs to bind to a socket. The only accessible ports are 80 and 443, however, Azure App Service itself is already bound to those. I suggest configuring your app with wfastcgi. See this example for details: https://github.com/theadriangreen/sample-azure-website-django-app

(Note: this is the same as gallery item for Django)

Post a Comment for "Django-based Azure Web App Getting Stuck When Development Server Is Run (on Kudu)"