Unable to set up virtual env for Django App

ehoke 56 Reputation points
2020-10-27T20:56:20.017+00:00

Hi I am trying to deploy a webapp to app service and I am consistently running into issues that are not covered by the tutorials. I have been using this tutorial for the deployment:
(1) https://learn.microsoft.com/en-us/azure/app-service/deploy-local-git
And this one for setting up the DB and running the app:
(2) https://learn.microsoft.com/en-us/azure/app-service/tutorial-python-postgresql-app?tabs=bash%2Cclone
The first is a new one:
After deployment, which is typically successful I tried running the command in tutorial (2) "source /antenv/bin/activate" and got a response that no directory could be found even though the file antenv3.6.tar.gz was present.
The second has persisted longer:
In the past when I have successfully set up the virtual environment and run the database migrations. When I navigate to the link that the app is supposed to be at nothing appears. I am wondering if it is because we do not explicitly start the program running like we do if we are running it locally. Otherwise please give any suggestions, the tutorials are not very clear on this topic.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,933 questions
0 comments No comments
{count} votes

Accepted answer
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2020-10-28T21:32:38.383+00:00

    @ehoke , Thanks for posting this question!

    If I have understood your question correctly, with the two docs that you have mentioned -the default WebApp deployment goes fine, but the error occurs only when activating default virtual environment. Just to highlight, an App Service detects a Django project by looking for a wsgi.py file in each subfolder (which then runs Gunicorn), which manage.py start project creates by default. So, when App Service finds that file, it loads the Django web app.

    Kindly use SSH or the Kudu console to connect directly to the App Service and verify that requirements.txt 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.
    If your files exist, then App Service wasn't able to identify your specific startup file.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.