Changeset 186
- Timestamp:
- 07/18/05 17:49:04 (3 years ago)
- Files:
-
- django/trunk/django/core/handlers/wsgi.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/handlers/wsgi.py
r185 r186 253 253 import django 254 254 self.application = application 255 self.media_dir = django.__path__[0] + '/conf/admin_ templates'255 self.media_dir = django.__path__[0] + '/conf/admin_media' 256 256 self.media_url = settings.ADMIN_MEDIA_PREFIX 257 257 … … 259 259 import os.path 260 260 261 # Ignore requests that aren't under ADMIN_MEDIA_PREFIX. 262 if not environ['PATH_INFO'].startswith(self.media_url): 261 # Ignore requests that aren't under ADMIN_MEDIA_PREFIX. Also ignore 262 # all requests if ADMIN_MEDIA_PREFIX isn't a relative URL. 263 if self.media_url.startswith('http://') or self.media_url.startswith('https://') \ 264 or not environ['PATH_INFO'].startswith(self.media_url): 263 265 return self.application(environ, start_response) 264 266 265 267 # Find the admin file and serve it up, if it exists and is readable. 266 file_path = os.path.join(self.media_dir, environ['PATH_INFO'][1:]) 268 relative_url = environ['PATH_INFO'][len(self.media_url):] 269 file_path = os.path.join(self.media_dir, relative_url) 267 270 if not os.path.exists(file_path): 268 271 status = '404 NOT FOUND'
