I've been trying to create a Django web app using VS2017 Preview (which includes Python tools for Visual Studio), and deploy the resulting app to Azure (I'm currently on the 30-day trial period to evaluate Azure).
I've done the following:
Start VS2017, create a new project with the "Django Web Project" template. This creates a Django webpage with the bootstrap template - simple, and everything works well locally.
In VS, go to Connected Services => Publish, select "Microsft Azure App Service", create a new App Service an an App Plan. The instances are created successfully.
Click "Publish" to publish via VS WebDeploy. Everything looks good in the console and it says
Publish: 1 succeeded, 0 failed, 0 skipped
at the end.
This results in the standard Azure Welcome-start-page hostingstart.html
showing, not the Django page. Once I remove that html file, there's only a The page cannot be displayed because an internal server error has occurred.
. I've tried various things: Going to portal.azure.com "Application Settings", setting Python version from "Off" to "3.4" (I'd like 3.5 in fact, which one of MS's tutorial uses - but any will do for now) - then there's just a hostingstart-python.html
showing, still no Django. I've tried adding a default web.config via "Add => New Item => Azure web.config (FastCGI)" in VS. I've tried editing that web.config with various values of WSGI_HANDLER
(e.g. django.core.handlers.wsgi.WSGIHandler()
) and DJANGO_SETTINGS_MODULE
(e.g. mydjangopage.settings
), I tried adding "wfastcgi" to requirements.txt, etc. Always just getting a server error.
I have been trying to do this for several hours now and I've read every possible Deployment help page from Microsoft, their blogs, and the web. All the information seems outdated, having missing pieces of information, or is just not working. At this point I'm quite disappointed and ready to give up. Isn't it supposed to be so simple? Create a new project in VS, hit "Publish", and it's supposed to work? (It's definitely not, I restarted from scratch multiple times and tried so many things.)