Skip to content

Static Files are Not Served Properly by IIS Even After Following Step 8 of the README (Creating a Virtual Directory for Static Files) #8

Description

@othmanalikhan

Environment
OS: Windows 10 Enterprise Evaluation (VM)
Build: 17763.rs5_release.180914-1434

Replicate

  1. Follow exactly as the README instructs.
  2. Navigate to the admin portal of your newly deployed Django app.
  3. You will notice some CSS and images not loading properly.

Possible Solution
I couldn't get static file configuration in settings.py to be respected by IIS, however, I was able to get IIS to serve static files directly via its own configuration.

  1. After following Step 8 of the README, click on the newly created "static" directory on the left column.
  2. Then double click the Handler Mappings icon.
  3. Then click on the "View Ordered List..." on the right column.
  4. Then click on "StaticFile" which is given least priority, and bump it up via "Move Up" on the right-column until it is top priority.
  5. Now navigate to your Django app and static files should be served properly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions