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

Fix issue with static files on Windows #474

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

marcperrinoptel
Copy link

See #472
also https://code.djangoproject.com/ticket/34341

The probable takeaway from the discussion on Django side is that finders.find() is really supposed to be called with an OS-standardized path.

I've mimicked what Django does to an url before calling finders.find():

  • step 1 (strip url base / prefix) was already done by whitenoise
  • step 2 (url2pathname) is obvious enough
  • step 3 (using posixpath.normpath, plus .lstrip('/')) seems debatable considering that we're already after url2pathname, but for the sake of mimicking Django I've included it

marcperrinoptel and others added 2 commits February 16, 2023 11:09
…url before calling finders.find (which really does need an OS-standardized path as input)
@Archmonger
Copy link

This needs a test to ensure there aren't regressions.

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

Successfully merging this pull request may close these issues.

None yet

2 participants