I am getting started with Azure App Services.
I followed this tutorial and was able to get the example main.py app running.
The modules (fastapi, uvicorn, etc...) specified in the requirements.txt are all installed and imported correctly.
However, when trying to import Python files located in the same directory as the main.py, deployment is still successful, but I am getting an application error when trying to browse by webpage: 
For instance, I created a file called settings.py, containing:
MY_TITLE = "My FastAPI prototype"
In this main.py, I simply modified:
app = FastAPI()
With:
import settings
app = FastAPI(title=f"{settings.MY_TITLE}")
But this failed! Please note that when I specify MY_TITLE in the main script, I am able to update the page's title correctly.
How can I import Python files from my main.py script on Azure App Services?
from ModuleNotFoundError while importing python files as modules in Azure App Services
No comments:
Post a Comment