Django on IIS 10 error 500.0

i am new with django and trying to install an application on IIS in windows 10.
i got HTTP 500.0 - Internal Server Error
and the error is referred to FastCgiModule
I think the problem is probably related to authorization and file/directory access permissions but cannot investigate !!!
Does anyone had the same problem??

I don’t have any specific information for you, maybe this page might give you some ideas:

I have “googled” for days and found many tutorials but i think that the problem is with windows permissions!!
Here they talk of “common problems” and one is 500.1 error from web.config as in my case!

They suggest a solution to unlock config, with 2 cmd commands->

%windir%\system32\inetsrv\appcmd unlock config -section:system.webServer/handlers

%windir%\system32\inetsrv\appcmd unlock config -section:system.webServer/modules


I think that to use python on the web in IIS is a great challenge!

Hoping someone that KNOW how to, can help me!

I think there may be a more fundamental issue here. You mention using the FastCgiModule, but according to How to use Django with FastCGI, SCGI, or AJP, it says:
Deprecated since version 1.7:
FastCGI support is deprecated and will be removed in Django 1.9.

This invalidates most blog posts and docs written before 2016. Anything dated 2015 or earlier is obsolete as far as Django is concerned with reference to IIS.

What you probably need to find is some documentation that specifically covers running IIS with WSGI (or ASGI) rather than FastCgi.

I did find a Python project, wfastcgi, that might serve as an appropriate bridge between the two protocols.

This may or may not help, however I found this video really useful when deploying to IIS

Also I found all the examples of the web.config files were close but none worked out of the box. After much trial and error, the ones that worked for me are below:

Static Folder:


Thank you so much for your suggestions.

I tried and tried with no luck.

I have a directory structure of a django project (published from visual studio in a local directory located in c:\inetpub\wwwroot\djangoweb

Under this dir i have the website structure as in file accluded.

Here My web.config that i saved in c:\inetpub\wwwroot\djangoweb

<?xml version="1.0" encoding="UTF-8"?>

       <add name="PythonHandler" 
          requireAccess="Script" />

   <add key="PYTHONPATH" value="C:\inetpub\wwwroot\DjangoWeb"/>
  <add key="WSGI_HANDLER" value="DjangoWeb.wsgi.application"/>
     <add key="WSGI_LOG" value="c:\inetpub\wwwroot\DjangoWeb\wfastcgi.log"/>


    <httpErrors errorMode="Detailed" />
            <httpRedirect enabled="false" destination="" exactDestination="true" />
            <add path="*">
                 <add provider="WWW Server" areas="Security" verbosity="Verbose" />
                <failureDefinitions statusCodes="404.2" />
    <directoryBrowse enabled="true" />


The error cames from the appsetting section of the web.config (i suppose) and is

Errore HTTP 500.19 - Internal Server Error

Maybe you can help me!?

yo bro im pretty sure that 500.19 error is solved in this video Running Django on Windows Using an IIS Server - YouTube, and its related with the ISS handlers been locked , so you just had to unlock them , but after that error is solved you will encounter the big daddy error which is the 500.0 error which we solved with this advance settings change that this forum shows IIS FastCGI An unknown error: 0x80070005 - Programmer Sought, resuming it says you gotta go to the ISS and into Application Pool → Advanced Settings → ID: ApplicationPoolIdentify then modify the default LocalSystem.
hope this can help you , it did help us so …
pd: by the way the concrete code error for the 500.0 was 0x8007010b