Opened 9 years ago

Closed 8 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: master
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: UI/UX:

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@…> 8 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 8 years ago by django25@…

  • Keywords slash trailing settings media_url added
  • Version set to SVN

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

Changed 8 years ago by Simon G. <dev@…>

comment:2 Changed 8 years ago by Simon G. <dev@…>

  • Has patch set
  • Summary changed from Non-obvious python "feature" requires explicit mention in documentation to [patch] MEDIA_URL should be documented as requiring a trailing slash with a path component
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

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