0

I would like to deploy an Django App on to Microsoft Azure through the App Service.

In the requirements.txt I have a package that I wrote myself and need to install from local directory which is in the same directory as manage.py.

I have tried to deploy the app through local git, and everytime it is running into the error it is not able to import the local package although it is able to install it with no problem in "antenv" (the virtual env Azure creates automatically)

1 Answers1

0

NEWEST

In azure webapp, it not support venv.

Suggestion:

You can copy and paste local package to site-packages folder to test, if not works, you should use docker container to test. But also need to add local package manually.

PRIVIOUS

I test it and it works fine.

I will share my test steps for you.

Step 1. Run successfully in local.

enter image description here

Step 2. Push project to https://yoursite.scm.azurewebsites.net/yourproject.git

enter image description here

You can follow the offical doc(Local Git deployment to Azure App Service).

enter image description here

Step 3. Visit your website.

enter image description here

You can download my sample code in github. You also need to add pyodbc then you can get same result with me. For more details, pls check this post(How to access ODBC Driver on Azure App service).

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
  • sorry, your answer does not answer my question. As I'm facing issues during deployment with "local package" in requirements.txt. Unlike those "official package" I can only install "local package" by providing the path of the package in my directory, but this fails during the "git push" stage of the deployment. – Chao Tang Nov 20 '20 at 17:26
  • In azure webapp, venv in python is not supported, and there is no need to entangle on this issue. It is recommended to manually put dependencies into the site-packages folder to try. If not feasible, it is recommended to use the container web app. – Jason Pan Nov 21 '20 at 08:45