Code

Changes between Version 14 and Version 15 of ContributedMiddleware


Ignore:
Timestamp:
07/03/06 07:00:40 (8 years ago)
Author:
Stefano J. Attardi <django@…>
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ContributedMiddleware

    v14 v15  
    2727For example /fr/article/... shows you the article in French, and /en/article/... shows it in English. 
    2828This version of the Locale from URL Middleware also sets a cookie and a request var whenever you go to a webpage that has a language set in it's url, so that it serves you the correct version when you go to a page that doesn't have any language code in it's url. 
     29 
     30=== [http://code.nailchiodo.com/nailchiodo/trunk/nailchiodo/urlmiddleware.py URL Middleware] by Stefano J. Attardi === 
     31 
     32Cleans up urls by adding/removing trailing slashes, adding/removing the www. prefix, and allowing the language to be set from the url. 
     33If APPEND_SLASH is set to False, trailing slashes are removed from the urls, except for urls which have an explicit trailing slash in urls.py. 
     34If REMOVE_WWW is set to True, the www. prefix is removed. 
     35Finally, ?lang=xx can be appended to any url to override the default language setting. This override is remembered for the following requests. For example, /article?lang=it would show the article in Italian regardless of brower settings or cookies, and any following request to the site would be shown in Italian by default.