I am learning the process to deploy Django Project through IIS and fastCGI. However, I am facing an error <handler> scriptProcessor could not be found in <fastCGI> application configuration.
After a little bit of research I've found that this error could be due to rights issue. Hence I've added permission (read, write, execute) for user DefaultAppPool in folder Python37 (contains python virtual environment) and similarly I've done this for folder wwwroot which is on C:\inetpub.
Python Virtual Environment: C:\python37 Web.config file path: C:\inetpub\wwwroot\web.config
Web.config
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <handlers> <add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="c:\python37\scripts\python.exe|c:\python37\lib\site-packages\wfastcgi.py>" resourceType="Unspecified" requireAccess="Script" /> </handlers> </system.webServer> <appSettings> <add key="PYTHONPATH" value="c:\python37\scripts\python.exe" /> <add key="WSGI_HANDLER" value="manhour_site.wsgi.application" /> <add key="DJANGO_SETTINGS_MODULE" value="manhour_site.settings" /> </appSettings> </configuration> After making changes above I am still facing the similar issue hence I looked at this solution. As per the solution fastCGI settings must be in the applicationHost.config file. This file is located on path C:\Windows\System32\inetsrv\config\applicationHost.config
After following this solution I've made following changes
applicationHost.config
Under <system.webServer> I've added following
<fastCgi> <application fullPath="c:\python37\scripts\python.exe" arguments="c:\python37\lib\site-packages\wfastcgi.py" maxInstances="4" signalBeforeTerminateSeconds="30"> <environmentVariables> <environmentVariable name="DJANGO_SETTINGS_MODULE" value="manhour_site.settings" /> <environmentVariable name="PYTHONPATH" value="c:\python37\scripts\python.exe" /> <environmentVariable name="WSGI_HANDLER" value="manhour_site.wsgi.application" /> </environmentVariables> </application> </fastCgi> I've ran the command as administrator wfastcgi-enable.
I need a solution that can point mistake and help in resolving this error.
PS: In my settings.py file I've changed following
DEBUG = 'False' STATIC_ROOT = os.path.join(BASE_DIR, 'static') Edit I've added HttpPlatformHandler to web.config
web.config
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <handlers> <add name="fastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="c:\python37\scripts\python.exe|c:\python37\lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" /> </handlers> <httpPlatform processPath="c:\python37\scripts\python.exe" arguments="C:\inetpub\wwwroot\manhour_site\manage.py --port %HTTP_PLATFORM_PORT%" stdoutLogEnabled="true" stdoutLogFile="c:\home\LogFiles\python.log" startupTimeLimit="60" processesPerApplication="16"> <environmentVariables> <environmentVariable name="SERVER_PORT" value="80" /> </environmentVariables> </system.webServer> <appSettings> <add key="PYTHONPATH" value="c:\python37\scripts\python.exe" /> <add key="WSGI_HANDLER" value="django.core.wsgi.get_wsgi_application()" /> <add key="DJANGO_SETTINGS_MODULE" value="manhour_site.settings" /> </appSettings> </configuration> The above changes causes error The requested page cannot be accessed because the related configuration data for the page is invalid.
Config File \\?\C:\inetpub\wwwroot\web.config
Related questions 0 Settings module not found deploying django on a shared server 2 Django: Deploying application using Apache and FastCGI 1 How to deploy django 1.5 with FastCGI Related questions 0 Settings module not found deploying django on a shared server 2 Django: Deploying application using Apache and FastCGI 1 How to deploy django 1.5 with FastCGI 2 How Deploy Django App IIS 1 Unable to deploy webpy application 8 Django on IIS: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet 3 python.exe the fastcgi process exited unexpectedly 0 Django Windows IIS Fastcgi Deploy problem (wfastcgi TypeError: 'module' object is not callable) 2 django on IIS winserver 2016 wfastcgi handler line 791 0 Module not found Error while deploying website Load 7 more related questions Show fewer related questions
Reset to default