Fix staticfiles finder in Windows failing when STATIC_URL is a full URL#94
Open
joaofrancese wants to merge 1 commit intojorgebastida:masterfrom
Open
Fix staticfiles finder in Windows failing when STATIC_URL is a full URL#94joaofrancese wants to merge 1 commit intojorgebastida:masterfrom
joaofrancese wants to merge 1 commit intojorgebastida:masterfrom
Conversation
….core.js when STATIC_URL is a full URL (such as http://www.example.com/static/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I had a full URL as my STATIC_URL setting (something like http://www.example.com/static/) and I was getting 404s for /static/dajaxice/dajaxice.core.js when testing my site locally (with manage.py runserver). This commit fixed it for me. It seemed to happen because staticfiles.views.serve was handing down to Dajaxice's finder a path with forward slashes, whereas it was expecting a path with backwards slashes.
I had to do a bit of a hack in my urls.py to get staticfiles to serve my files even with a full URL in STATIC_URL (is there a better way? I'm not aware of one), so I guess this isn't a common use case.