Error occurred while reading WSGI handler - Deploy django to azure web app -


very related post don't have priviledge comment there had make new post. deploy simple vs2017 django app azure - server error

i followed silencer's tutorial there , getting error \logfiles\wfastcgi.log:

2017-07-28 08:28:57.746719: activating virtualenv d:\home\site\wwwroot\env\scripts\python.exe 2017-07-28 08:28:57.777987: error occurred while reading wsgi handler:  traceback (most recent call last):   file "d:\home\python360x64\wfastcgi.py", line 791, in main     env, handler = read_wsgi_handler(response.physical_path)   file "d:\home\python360x64\wfastcgi.py", line 633, in read_wsgi_handler     handler = get_wsgi_handler(os.getenv("wsgi_handler"))   file "d:\home\python360x64\wfastcgi.py", line 605, in get_wsgi_handler     handler = handler()   file ".\ptvs_virtualenv_proxy.py", line 99, in get_virtualenv_handler     execfile(activate_this, dict(__file__=activate_this))   file ".\ptvs_virtualenv_proxy.py", line 27, in execfile     code = f.read()   file "d:\repos\azure-python-siteextensions\source_packages\python.3.6.0\tools\lib\encodings\cp1252.py", line 23, in decode unicodedecodeerror: 'charmap' codec can't decode byte 0x90 in position 2: character maps <undefined> 

i have installed python360x64 extension in azure portal, using https://github.com/azure/azure-sdk-for-python/blob/master/examples/azureresourceviewer/ptvs_virtualenv_proxy.py , web.config:

<configuration>   <system.diagnostics>     <trace>       <listeners>         <add type="microsoft.windowsazure.diagnostics.diagnosticmonitortracelistener, microsoft.windowsazure.diagnostics, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" name="azurediagnostics">           <filter type="" />         </add>       </listeners>     </trace>   </system.diagnostics>   <appsettings>     <add key="wsgi_alt_virtualenv_handler" value="django.core.wsgi.get_wsgi_application()" />     <add key="wsgi_alt_virtualenv_activate_this" value="d:\home\site\wwwroot\env\scripts\python.exe" />     <add key="wsgi_handler" value="ptvs_virtualenv_proxy.get_virtualenv_handler()" />     <add key="pythonpath" value="d:\home\site\wwwroot" />     <add key="django_settings_module" value="djangowebproject.settings" />     <add key="wsgi_log" value="d:\home\logfiles\wfastcgi.log"/>   </appsettings>   <system.web>     <compilation debug="true" targetframework="4.0" />   </system.web>   <system.webserver>     <modules runallmanagedmodulesforallrequests="true" />     <handlers>       <add name="python fastcgi" path="handler.fcgi" verb="*" modules="fastcgimodule" scriptprocessor="d:\home\python360x64\python.exe|d:\home\python360x64\wfastcgi.py" resourcetype="unspecified" requireaccess="script" />     </handlers>     <rewrite>       <rules>         <rule name="static files" stopprocessing="true">           <conditions>             <add input="true" pattern="false" />           </conditions>         </rule>         <rule name="configure python" stopprocessing="true">           <match url="(.*)" ignorecase="false" />           <conditions>             <add input="{request_uri}" pattern="^/static/.*" ignorecase="true" negate="true" />           </conditions>           <action type="rewrite" url="handler.fcgi/{r:1}" appendquerystring="true" />         </rule>       </rules>     </rewrite>   </system.webserver> </configuration> 

my /env/ python version python360x64. appreciated!

i same errors in python 3.4. python 2.7 there activate_this.py script, can in way.

just put activate_this.py python 2.7 virtual environment in .\env\scripts folder , changed path in web.config point activate_this.py.

it seems work. not sure version of python using 2.7 still present on system.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -