skip to Main Content

FAST CGI IS NOT WORKING PROPERLY IN DJANGO DEPLOYMENT ON IIS WINDOW SERVER


HTTP Error 500.0 - Internal Server Error

C:Userssatish.palAppDataLocalProgramsPythonPython310python.exe - The FastCGI process exited unexpectedly



Most likely causes:
•IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
•IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
•IIS was not able to process configuration for the Web site or application.
•The authenticated user does not have permission to use this DLL.
•The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.



Things you can try:
•Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
•Check the event logs to see if any additional information was logged.
•Verify the permissions for the DLL.
•Install the .NET Extensibility feature if the request is mapped to a managed handler.
•Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here. 



Detailed Error Information:



Module
   FastCgiModule 

Notification
   ExecuteRequestHandler 

Handler
   fastcgiModule 

Error Code
   0x00000001 



Requested URL
   http://10.0.0.5:8097/ 

Physical Path
   C:inetpubwwwroothcm.ariespro.com 

Logon Method
   Anonymous 

Logon User
   Anonymous 




More Information:
This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error. 
View more information »

Microsoft Knowledge Base Articles:
•294807

i HAVE TRIED EVERY THIN FROM GIVING APPpOOL PERMITTIONS TO CHANGING VERSIONS OF PYTHON AND WFASTCGI

BUT NOTHING IS WORKING FOR ME

PROJECT IS WORKING JUST FINE ON DJANGO SERVER

I HAVE ALSO DEPLOYED IT USING NGINX AND WAITRESS FROM WINDOYS SERVER BUT I NEED IT TO WORK WITH IIS
PLEASE hELP ME OUT– AT ANY COST

2

Answers


  1. Chosen as BEST ANSWER

    check the directory in which python is installed and move all the packages into the same folder I resolved the issue by storing all the packages in a single folder in c drive outside the users' folder so that wwwroot can easily access the directory and you do need to give permissions to iis pool to access the python and w FastCGI module.


  2. IIS provides many features for hosting Web applications. Python web applications can be hosted by the Httpplatformhandler and FastCGI features. For Python developers, learning HttpPlatformHandler becomes very important, Microsoft no longer recommends FastCGI, so this is no longer the right way to host Python web applications on IIS, you can switch to HttpPlatformHandler.

    Download and Install Httpplatformhandler on IIS using Windows Platform Installer. Or download from this link.

    You can use the following steps to host a Django web application using Httpplatformhandler:

    For Django physical path is a path to manage.py of your application.

    Django APP with Httpplatformhandler Add web.config where your Django app is defined.

     <?xml version="1.0" encoding="UTF-8"?>
         <configuration>
             <system.webServer>
                 <handlers>
                     <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"
     requireAccess="Script" />
                 </handlers>
                 <httpPlatform startupTimeLimit="10" startupRetryCount="10" stdoutLogEnabled="true"
     processPath="C:UsersuserAppDataLocalProgramsPythonPython36python.exe"
     arguments="manage.py runserver">
                     <environmentVariables>
                         <environmentVariable name="foo" value="bar"/>
                     </environmentVariables>
                 </httpPlatform>
             </system.webServer>
         </configuration>
    

    HttpPlaform is handling the Python process. ProcessPath is a physical
    path to python executable. Just like you provide python path in a
    windows environment variable. To access the python executable. Here
    you have to provide python.exe in processPath.

    Arguments are the same argument you pass running any python web
    application. For eg. python manage.py runserver where app.py to port
    number all are arguments. In the above application, manage.py
    runserver is passed to run Django application.

    Add Permission to Django Application and Python folder where your executable is present.

    1.Open folder properties.

    2.In Security click on Edit then click on Add

    3.Enter object name as IIS AppPool

    4.Click on the check name if its present click ok and allow permissions you wanted to give then apply it.

    For more information, please refer to this article.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search