Changeset 101
- Timestamp:
- 10/24/09 20:31:14 (9 months ago)
- Location:
- trunk/courant
- Files:
-
- 10 added
- 1 removed
- 3 modified
-
core/headers (added)
-
core/headers/__init__.py (added)
-
core/headers/admin.py (added)
-
core/headers/context_processors.py (added)
-
core/headers/middleware.py (added)
-
core/headers/migrations (added)
-
core/headers/migrations/0001_initial.py (added)
-
core/headers/migrations/0002_add_defaults.py (added)
-
core/headers/migrations/__init__.py (added)
-
core/headers/models.py (added)
-
core/mobile (deleted)
-
core/utils/__init__.py (modified) (1 diff)
-
core/utils/middleware.py (modified) (2 diffs)
-
default_settings.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/courant/core/utils/__init__.py
r96 r101 15 15 arguments = [arg for arg in args] 16 16 templates = [] 17 for template in arguments[0]: 18 if template: 19 templates.append(''.join([template, '.', request.extension])) 17 18 for extension in request.extension: 19 for template in arguments[0]: 20 if template: 21 templates.append(''.join([template, '.', extension])) 22 20 23 arguments[0] = templates 21 24 -
trunk/courant/core/utils/middleware.py
r81 r101 35 35 if request.path.rfind('.') > request.path.rfind('/') and not self._string_in_list(settings.FILE_EXTENSION_IGNORE, request.path): 36 36 # Add extension to request object so that it can be accessed in views 37 request.extension = request.path[request.path.rfind('.')+1:]37 request.extension = [request.path[request.path.rfind('.')+1:],] 38 38 39 39 # Change path_info so that URL matching occurs properly … … 49 49 newurl += '?' + request.META['QUERY_STRING'] 50 50 return http.HttpResponsePermanentRedirect(newurl) 51 request.extension = 'html'51 request.extension = ['html',] 52 52 53 53 def _is_valid_path(path): -
trunk/courant/default_settings.py
r97 r101 43 43 'django.contrib.sessions.middleware.SessionMiddleware', 44 44 'django.contrib.auth.middleware.AuthenticationMiddleware', 45 'courant.core. mobile.middleware.MobileMiddleware',45 'courant.core.headers.middleware.HttpHeadersMiddleware', #new HTTP headers middleware 46 46 'courant.contrib.shorturls.middleware.ShortUrlMiddleware', 47 47 'django.contrib.redirects.middleware.RedirectFallbackMiddleware', … … 59 59 'django.core.context_processors.debug', 60 60 'courant.core.media.context_processors.media', 61 'courant.core.headers.context_processors.headers', 61 62 ) 62 63 … … 109 110 'courant.core.siteconfig', 110 111 'courant.core.mailer', 112 'courant.core.headers', 111 113 ) 112 114