0

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?

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

<configuration>

    <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>
</configuration>

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

Ivan Starostin
  • 8,798
  • 5
  • 21
  • 39

1 Answers1

0

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?

Jalpa Panchal
  • 8,251
  • 1
  • 11
  • 26