MCPcopy
hub / github.com/django/django / file_path

Method file_path

django/contrib/staticfiles/handlers.py:41–46  ·  view source on GitHub ↗

Return the relative path to the media file on disk for the given URL.

(self, url)

Source from the content-addressed store, hash-verified

39 return path.startswith(self.base_url.path) and not self.base_url.netloc
40
41 def file_path(self, url):
42 """
43 Return the relative path to the media file on disk for the given URL.
44 """
45 relative_url = url.removeprefix(self.base_url.path)
46 return url2pathname(relative_url)
47
48 def serve(self, request):
49 """Serve the request path."""

Callers 1

serveMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected