It turns out that I was not very up to date regarding the state of
MultilingualURLMiddleware. I just noticed this commit:
This breaks the code (which I had commited) that implements the behaviour I
described (the language code should be placed after 'pages-root'). Now the
behaviour is that the language code is always the first component of the
URL, regardless of your urlconf and django.root settings. This clearly
precludes your setup.
Now some discussion on the current implementation of
I understand that the aforementioned commit tries to fix
But even though the fix may work for the scenario described in the bug
report, it makes flawed assumptions. It assumes that *all* software you run
on your web server (django-cms, django, php...) support the language prefix
at the beggining of the URL. This doesn't sound like a realistic setup to
The pre-c80003ce5680 code on the other hand assumed that django-cms operates
in its own namespace which starts from 'pages-root' without making any
assumptions for the configuration of the rest of the software you run on
your web server. For this, I find it much cleaner and more coherent wrt the
django config options (django.root, 'pages-root').
Although I favour the pre-c80003ce5680 functionality, I'd still be glad to
see MultilingualURLMiddleware phased out for something more elegant. I mean,
take a look on the monster regexs in multilingual.py... :-)
But if MultilingualURLMiddleware is here to stay, maybe the core developers
should discuss what is the correct behaviour for MultilingualURLMiddleware
and document it in the code so that we avoid further flip-flops.
Just my 2c...
2011/7/6 paul_from_champs <paoloromol...@gmail.com>