I am trying to deploy my Django application with Azure DevOps as a Azure Web App. The application is pipelined and build to the web app but it will not run.
When I am trying to run py manage.py runserver
in the Diagnostic Console i get the error below:
D:\Python34\python.exe: can't open file 'manage.py': [Errno 0] No error
Does anyone have a clue on what the issue might be? This is the first project I am trying to deploy with Azure so my knownledge is not very good. The project files are stored on the following location on the server
D:\home\site\wwwroot\<applicationName>
I am sometimes getting this error as well:
Window title cannot be longer than 1023 characters.
Filestructure
wwwroot
--- applicationname
------ api
------ applicationname
------ .env
------ db.sqlite3 (empty and not in use)
------ manage.py
------ requirements.txt
Things that have been tried to solved the issue
- Changing the filepath in Configuration -> Path Mappings -> Physical Path after an idea from Jason Pan
- Add a web.config file (Added in wwwroot -> applicationname -> web.config). The Config file is pasted below. This resulted in the following error:
The specified CGI application encountered an error and the server terminated the process.
Web.Config file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*"
modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="D:\home\python364x64\python.exe" arguments="manage.py runserver %HTTP_PLATFORM_PORT%" requestTimeout="00:04:00" startupTimeLimit="120" startupRetryCount="3" stdoutLogEnabled="true">
<environmentVariables>
<environmentVariable name="PYTHONPATH" value="D:\home\site\wwwroot"/>
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
Thank you for your help.
SOLUTION
After huge help from Jason Pan i manage to set it up as a Container Service instead and the app is now working as it should! Thank you very much Jason!