Hi Paul,
It turns out that I was not very up to date regarding the state of
MultilingualURLMiddleware. I just noticed this commit:
https://github.com/divio/django-cms/commit/c80003ce5680abf04e42cafb6a...
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
MultilingualURLMiddleware...
I understand that the aforementioned commit tries to fix
https://github.com/divio/django-cms/issues/559.
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
me.
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...
Cheers,
Manolis
2011/7/6 paul_from_champs <paoloromol...@gmail.com>
> Hello Manolis, I tried both options but I've got the same error. I'm
> currently using apache with mod_python. From the apache conf file:
> <Location "/mysite">
> SetEnv DJANGO_SETTINGS_MODULE settings
> PythonInterpreter mysite
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> PythonOption django.root /mysite
> PythonDebug On
> PythonPath "['/srv/mysite'] + sys.path"
> </Location>
> Alias /mysite/media /srv/mysite/media
> <Directory /srv/mysite/media>
> Order deny,allow
> Allow from all
> </Directory>
> and in my urls.py I 've included: url(r'^', include('cms.urls'))
> Everything works fine, django, django admin the cms except the
> MultilingualURLMiddleware . I've also tried removing django.root and editing
> the urls.py as told but it doesn't work either. Thanks alot for your answer
> --
> You received this message because you are subscribed to the Google Groups
> "django-cms" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-cms/-/rSXefOiqkSYJ.
> To post to this group, send email to django-cms@googlegroups.com.
> To unsubscribe from this group, send email to
> django-cms+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-cms?hl=en.