On Mon, Jun 1, 2009 at 8:39 AM, Damien MATHIEU <4...@dmathieu.com> wrote:

>
> Based on the advices of a friend, I've tried with mod_wsgi instead of
> mod_python.
> However, it still doesn't work.
>
> And the sys.path is similar to the one I have when I do a manage.py
> runserver (where I correctly have my language strings).
>
> So it's not a path problem.
>

You've included Graham's response below but you have apparently not acted on
any of its advice.  Graham doesn't mention a path problem, nor does he
suggest that switching to mod_wsgi would fix the issue: he mentions an
environment problem, specifically related to the locale environment
variables.  Perhaps if you follow Graham's advice below about writing a view
that displays os.environ variables and compare the values between
development server and Apache you will make more progress.

Karen


>
> On May 29, 1:51 am, Graham Dumpleton <graham.dumple...@gmail.com>
> wrote:
> > On May 28, 11:56 pm, Damien MATHIEU <4...@dmathieu.com> wrote:
> >
> >
> >
> > > Hi,
> >
> > > Using the internal web server, I correctly load every language string
> > > located in application_path/locale/language/LC_MESSAGES/django.mo
> > > But whenever I use Apache, they don't appear to be loaded anymore.
> >
> > > However it appear the default ones are loaded.
> > > The languages names are appropriately translated (French to Français
> > > for example).
> >
> > > I have the following virtual host :
> > > <VirtualHost *:80>
> > >     DocumentRoot /home/git/refdoc
> > >     ServerName doc.tmp.dev.refstats.net
> > >     ServerAlias doc.tmp.dev.refstats.net
> > >     SetEnv DJANGO_SETTINGS_MODULE setting.production
> >
> > >     <Location "/">
> > >         SetHandler python-program
> > >         PythonHandler django.core.handlers.modpython
> > >         PythonPath "['/home/git/refdoc'] + sys.path
> > >         PythonDebug On
> > >     </Location>
> > > </VirtualHost>
> >
> > > And I use localeurl :http://code.google.com/p/django-localeurl/
> >
> > > Thanks by advance for any help you'll hopefully provide me.
> >
> > The development server is likely working because it is picking up
> > locale and language environment variables from your personal account.
> > When running Apache, which starts up as root before changing to non
> > privileged user, it will not be getting those environment variables
> > from your personal account. As such, it will use whatever is the
> > system default.
> >
> > Often it is not enough to just set the variables from inside Apache or
> > your code and you need to ensure they are set in the environment of
> > Apache when it runs. How this is done depends a bit on whether you are
> > using Apache compiled from source or some specific operating systems
> > distribution.
> >
> > I would start by writing a test URL which dumps out os.environ in each
> > way of running it, then compare settings for LC_* and LANG environment
> > variables.
> >
> > Graham
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to