Translations with Django 1.5.11 and Apache
Question: I am using django 1.5.11 with translations having the locale folder not in the
site directory. I used the LOCALE_PATHS variable to set the correct folder.
When I start my application using runserver, either in my machine or the
server, the translation work correctly. The problems come when I do it with
wsgi. My django app is served with apache 2.4 and mod_wsgi compiled with
python 2.7.10 with the following wsgi script:

    
    
    import os
    import sys
    import site
    site.addsitedir('/path/to/virtualenvs/site-packages')
    
    sys.path.append('/app/folder/')
    sys.path.append('/settings/folder/')
    sys.path.append('/virtualenvs/site-packages')
    sys.path.append('/virtualenvs/bin')
    
    os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
    
    activate_env=os.path.expanduser("/virtualenvs/bin/activate_this.py")
    execfile(activate_env, dict(__file__=activate_env))
    
    import django.core.handlers.wsgi
    application = django.core.handlers.wsgi.WSGIHandler()
    

when started apache the translation is not working, it looks like the
LOCALE_PATHS is ignored and look for the translation in the site folder
instead. I don't understand where this behaviour is coming from (apache
mod_wsgi maybe?). Has anyone else experienced the same?


Answer: I just stumbled upon this issue, albeit with Django 1.8.15. It seems that
you'll have to provide an absolute path for the `LOCALE_PATHS` for this to
work with Apache. Relative paths do not seem to work on the server, while they
do work locally. Not sure what causes this behavior though.

