'The FastCGI process exited unexpectedly - (Django iis hosting)

I am following this tutorial to hosting my django application on windows IIS Manager. After following all steps from the tutorial I have got the following HTTP Error 500.0 - Internal Server Error

Is there any way to solve the issue?? I didn't find any solution for this...

I am using,

Python==3.10.0  
Django==3.2.8  
wfastcgi==3.0.0  
IIS 10.0.17763.1


Solution 1:[1]

I had this same issue (Error code 0x00000067) and have been beating my head against a wall for 24 hours. I am new to Windows servers, but have been deploying Django Apps on Linux servers for over a decade.

In my case, I had deviated from the Johnnyboycurtis tutorial you referenced in a few ways:

  • I tried to install every python package in a virtual environment
  • I did not install Python at C:\, but rather hidden under my user's AppData\local\Programs\Python dir (the default)

I am assuming that your app works when running the Django Development server (py manage.py runserver -> http://localhost:8000 ) your app looks as expected (when DEBUG = True in settings.py)

Fixing my code install meant taking the following steps:

  • Navigating to C:\Users\MyUserName\AppData\local\Programs\Python, and following Johnnyboycurtis' instructions (but on Python310 instead of Python37) I added permissions for my AppPool to run Python.
  • I had to install wfastcgi OUTSIDE of my virtual environment:
    • deactivate (if you have a python virtual environment activated)
    • py -m pip install wfastcgi

Note that I did NOT have to change any other settings that were assuming my virtual environment:

  • web.config: 'scriptProcessor' still points to a python.exe and wfastcgi.py inside my virtual environment
  • IIS FastCGI Settings 'Full Path' and 'Arguments' both refer to files in my virtual environment

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman