Ticket #6218: dj.slash.patch
File dj.slash.patch, 1.8 KB (added by , 17 years ago) |
---|
-
django/db/models/base.py
374 374 375 375 def _get_FIELD_url(self, field): 376 376 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('\\', '/') 379 378 return '' 380 379 381 380 def _get_FIELD_size(self, field): -
django/conf/project_template/settings.py
38 38 MEDIA_ROOT = '' 39 39 40 40 # 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/" 43 43 MEDIA_URL = '' 44 44 45 45 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -
docs/settings.txt
683 683 Default: ``''`` (Empty string) 684 684 685 685 URL that handles the media served from ``MEDIA_ROOT``. 686 Example: ``"http://media.lawrence.com "``686 Example: ``"http://media.lawrence.com/"`` 687 687 688 Note that this should have a trailing slash if it has a path component.688 This should have a trailing slash. 689 689 690 690 Good: ``"http://www.example.com/static/"`` 691 691 Bad: ``"http://www.example.com/static"``