Azure Flask Routes Not Found
Solution 1:
Please refer to my work steps and see if the error still shows up.
Step 1 : Create azure web app and add Extensions(here is Python 3.6.1 x64)
Step 2 : Publish your flask
project and add the web.config
.
web.config:
<?xml version="1.0" encoding="utf-8"?><configuration><appSettings><addkey="WSGI_HANDLER"value="<Your Project Name>.app"/><addkey="PYTHONPATH"value="D:\home\site\wwwroot"/><addkey="WSGI_LOG"value="D:\home\LogFiles\wfastcgi.log"/></appSettings><system.webServer><handlers><addname="PythonHandler"path="*"verb="*"modules="FastCgiModule"scriptProcessor="D:\home\Python361x64\python.exe|D:\home\Python361x64\wfastcgi.py"resourceType="Unspecified"requireAccess="Script"/></handlers></system.webServer></configuration>
If you deploy successfully, you could see following structure in the KUDU
path: D:\home\site\wwwroot>
.
If you want to use additional python package, please go on.
Step 3: Switch to the Kudu CMD and commands cd Python361x64
and touch get-pip.py
and copy the content of the url https://bootstrap.pypa.io/get-pip.py
into the get-pip.py
via Edit button, then run python get-pip.py
to install the pip tool.
Step 4 : Install any packages you need via python -m pip install pyodbc
Hope it helps you. Any concern ,please let me know.
Update:
In my steps, copy content in https://bootstrap.pypa.io/get-pip.py
to install pip. It could identify the system python version, install the corresponding python package.
So,you just need to run the command python -m pip install newspaper3k
to install newspaper3k
.
Post a Comment for "Azure Flask Routes Not Found"