Opened 18 years ago

Closed 18 years ago

#2296 closed defect (fixed)

[patch] MEDIA_URL should be documented as requiring a trailing slash with a path component

Reported by: nwp@… Owned by: Jacob
Component: Documentation Version: dev
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
Easy pickings: no UI/UX: no

Description

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).

Cheers,

Nick

Attachments (1)

2296.diff (580 bytes ) - added by Simon G. <dev@…> 18 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by django25@…, 18 years ago

Keywords: slash trailing settings media_url added
Version: SVN

Could the settings documentation at least be updated to show that a trailing slash is required? Seems like a no-brainer to me...

by Simon G. <dev@…>, 18 years ago

Attachment: 2296.diff added

comment:2 by Simon G. <dev@…>, 18 years ago

Has patch: set
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: UnreviewedReady for checkin

comment:3 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [4399]) Fixed #2296 -- Documented required trailing slash for MEDIA_URL. Thanks, nwp@…

Note: See TracTickets for help on using tickets.
Back to Top