Django web server running with iis doesn't run static css js image files

enter image description herehi I have a django web server project running on ISP and static file is not working

How do I make changes to Internet Information Services (IIS) and web cofig file for static files to work?

`

<appSettings>
<!-- Required settings -->
<add key="WSGI_HANDLER" value="django.core.wsgi.get_wsgi_application()" />
<!-- Your django path -->
<add key="PYTHONPATH" value="C:\inetpub\wwwroot\pax_web_server_app" /> 
<!-- Your djangoname.settings -->
<add key="DJANGO_SETTINGS_MODULE" value="pax_web_server_app.settings" />
</appSettings>

<system.webServer>
    <handlers>

        <add name="paxsite" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\Python311\python.exe|C:\Python311\Lib\site-packages\wfastcgi.py" resourceType="Unspecified" />

    </handlers>
    <staticContent>

        <mimeMap fileExtension=".tab" mimeType="static/css" />

    </staticContent>
</system.webServer>
`

https://learn.microsoft.com/en-us/iis/configuration/system.webserver/staticcontent/mimemap

I did the instructions on the microsoft website but it still didn't work

Create virtual directory in iis with the name of static and point the path to that virtual directory with your actual static folder

Here is the link you can refer for the more details:

How to fetch static CSS files with django on IIS?

Back to Top