[patch] MEDIA_URL should be documented as requiring a trailing slash with a path component
|Reported by:||Owned by:||Jacob|
|Severity:||normal||Keywords:||slash trailing settings media_url|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Due to the not-immediately-intuitive way python's urlparse.urljoin() works, MEDIA_URL requires a trailing slash if it includes a path component -- otherwise the last component of the path will be removed in the urljoin.
It would be good to point this out in the documentation wherever MEDIA_URL is mentioned, and provide an example in the default settings.py that makes this obvious (currently the example setting there has no path component).
Change History (4)
comment:2 Changed 10 years ago by
|Summary:||Non-obvious python "feature" requires explicit mention in documentation → [patch] MEDIA_URL should be documented as requiring a trailing slash with a path component|
|Triage Stage:||Unreviewed → Ready for checkin|