Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
othmanalikhan opened this issue Apr 9, 2021 · 1 comment

Comments

@othmanalikhan
Copy link

othmanalikhan commented Apr 9, 2021

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.
@lextm
Copy link

lextm commented Mar 31, 2024

Read #15 and you can find a good alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants