Ticket #12323: static_media.diff
File static_media.diff, 2.5 KB (added by , 15 years ago) |
---|
-
django/conf/global_settings.py
236 236 # Example: "http://media.lawrence.com" 237 237 MEDIA_URL = '' 238 238 239 # To differentiate between user uploaded and "really" static content 240 STATIC_ROOT = MEDIA_ROOT 241 STATIC_URL = MEDIA_URL 242 239 243 # List of upload handler classes to be applied in order. 240 244 FILE_UPLOAD_HANDLERS = ( 241 245 'django.core.files.uploadhandler.MemoryFileUploadHandler', -
django/forms/widgets.py
70 70 def absolute_path(self, path): 71 71 if path.startswith(u'http://') or path.startswith(u'https://') or path.startswith(u'/'): 72 72 return path 73 return urljoin(settings. MEDIA_URL,path)73 return urljoin(settings.STATIC_URL,path) 74 74 75 75 def __getitem__(self, name): 76 76 "Returns a Media object that only contains media of the given type" -
django/core/context_processors.py
64 64 Adds media-related context variables to the context. 65 65 66 66 """ 67 return {'MEDIA_URL': settings.MEDIA_URL} 67 return {'MEDIA_URL': settings.MEDIA_URL, 68 'STATIC_URL': settings.STATIC_URL} 68 69 69 70 def request(request): 70 71 return {'request': request} -
docs/ref/settings.txt
980 980 981 981 .. _site framework docs: ../sites/ 982 982 983 .. setting:: STATIC_ROOT 984 985 STATIC_ROOT 986 ---------- 987 988 Default: ``MEDIA_ROOT`` 989 990 Absolute path to the directory that holds media for this installation. 991 Example: ``"/home/media/media.lawrence.com/"`` 992 See also ``STATIC_URL``, ``MEDIA_ROOT``, ``MEDIA_URL``. 993 994 .. setting:: STATIC_URL 995 996 STATIC_URL 997 --------- 998 999 Default: ``MEDIA_URL`` 1000 1001 URL that handles the media served from ``STATIC_ROOT``. 1002 Example: ``"http://static.lawrence.com"`` 1003 1004 Note that this should have a trailing slash if it has a path component. 1005 1006 Good: ``"http://www.example.com/static/"`` 1007 Bad: ``"http://www.example.com/static"`` 1008 1009 See also ``MEDIA_URL`` 1010 983 1011 .. setting:: TEMPLATE_CONTEXT_PROCESSORS 984 1012 985 1013 TEMPLATE_CONTEXT_PROCESSORS