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

1 Answer 1

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?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.