Changeset 101

Show
Ignore:
Timestamp:
10/24/09 20:31:14 (9 months ago)
Author:
rsbaskin
Message:

courant.core.headers, huzzah!

Includes hints about what is coming next!

Location:
trunk/courant
Files:
10 added
1 removed
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/courant/core/utils/__init__.py

    r96 r101  
    1515    arguments = [arg for arg in args] 
    1616    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     
    2023    arguments[0] = templates 
    2124 
  • trunk/courant/core/utils/middleware.py

    r81 r101  
    3535        if request.path.rfind('.') > request.path.rfind('/') and not self._string_in_list(settings.FILE_EXTENSION_IGNORE, request.path): 
    3636            # 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:],] 
    3838 
    3939            # Change path_info so that URL matching occurs properly 
     
    4949                    newurl += '?' + request.META['QUERY_STRING'] 
    5050                return http.HttpResponsePermanentRedirect(newurl) 
    51             request.extension = 'html' 
     51            request.extension = ['html',] 
    5252 
    5353def _is_valid_path(path): 
  • trunk/courant/default_settings.py

    r97 r101  
    4343    'django.contrib.sessions.middleware.SessionMiddleware', 
    4444    'django.contrib.auth.middleware.AuthenticationMiddleware', 
    45     'courant.core.mobile.middleware.MobileMiddleware', 
     45    'courant.core.headers.middleware.HttpHeadersMiddleware', #new HTTP headers middleware 
    4646    'courant.contrib.shorturls.middleware.ShortUrlMiddleware', 
    4747    'django.contrib.redirects.middleware.RedirectFallbackMiddleware', 
     
    5959    'django.core.context_processors.debug', 
    6060    'courant.core.media.context_processors.media', 
     61    'courant.core.headers.context_processors.headers', 
    6162) 
    6263 
     
    109110    'courant.core.siteconfig', 
    110111    'courant.core.mailer', 
     112        'courant.core.headers', 
    111113) 
    112114