Ticket #6218: dj.slash.patch

File dj.slash.patch, 1.8 KB (added by Michael Toomim <toomim@…>, 17 years ago)

Patch for base.py and settings.py template docs

  • django/db/models/base.py

     
    374374
    375375    def _get_FIELD_url(self, field):
    376376        if getattr(self, field.attname): # value is not blank
    377             import urlparse
    378             return urlparse.urljoin(settings.MEDIA_URL, getattr(self, field.attname)).replace('\\', '/')
     377            return (settings.MEDIA_URL + getattr(self, field.attname)).replace('\\', '/')
    379378        return ''
    380379
    381380    def _get_FIELD_size(self, field):
  • django/conf/project_template/settings.py

     
    3838MEDIA_ROOT = ''
    3939
    4040# URL that handles the media served from MEDIA_ROOT. Make sure to use a
    41 # trailing slash if there is a path component (optional in other cases).
    42 # Examples: "http://media.lawrence.com", "http://example.com/media/"
     41# trailing slash.
     42# Examples: "http://media.lawrence.com/", "http://example.com/media/"
    4343MEDIA_URL = ''
    4444
    4545# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
  • docs/settings.txt

     
    683683Default: ``''`` (Empty string)
    684684
    685685URL that handles the media served from ``MEDIA_ROOT``.
    686 Example: ``"http://media.lawrence.com"``
     686Example: ``"http://media.lawrence.com/"``
    687687
    688 Note that this should have a trailing slash if it has a path component.
     688This should have a trailing slash.
    689689
    690690Good: ``"http://www.example.com/static/"``
    691691Bad: ``"http://www.example.com/static"``
Back to Top