Skip to content
Advertisement

Django Web App running on local Debian 10 but failing on Azure

I can run my web app on my local machine – no errors. But when porting the directory strcture to Azure, I get the ModuleNotFoundError: No module named 'django'.

Here is what I did:

  • My app is publicly available on GitHub. The app runs in a virtual environment (called deploydjango). That is reflected in the tree structure of the repo.
  • I ensured that Python version was correct (3.8 as on my local machine).
  • I posted the code to Azure (using the Azure extension of Visual Studio Code).
  • When browsing to the web app URL, I get the error message:
JavaScript
  • That takes me to Diagnose and solve problems on Azure page for the Web App Service. Here I find Availability and Performance.
    • Herein the tab “Web App Dow” is found.
      • Under Application Logs I am advised, that: Application logs from instance: lw0sdlwk00016P contain an error or a warning
      • Clicking More info, I get a log telling me:
JavaScript

Advertisement

Answer

2021-02-18T12:02:07.203377427Z from django.core.wsgi import get_wsgi_application 2021-02-18T12:02:07.203381027Z ModuleNotFoundError: No module named ‘django’

above two lines says Django is not installed

If it is installed then check the below documentation:

https://learn.microsoft.com/en-us/azure/app-service/configure-language-python#customize-startup-command

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement