Opened 16 years ago
Closed 16 years ago
#7450 closed defect (worksforme)
localized trac doesn't translate with mod_wsgi
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | web frontend | Version: | |
Severity: | major | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
If I start it up as standalone it works, I can see the default page accept my native language (probably through accept-language header) and while logged in there is a preference page which works too.
But if I try it via wsgi it doesn't work. Probably babel doesn't load when using the wsgi script instead of standalone.py . No prefpane, no defaultlanguage, even the info saved before with the working copy has no effect, still everything on english.
my wsgi script:
import os os.environ['TRAC_ENV_PARENT_DIR'] = '/usr/local/trac/var' os.environ['PYTHON_EGG_CACHE'] = '/usr/local/trac/cache' os.environ['HGENCODING'] = 'utf-8' import sys sys.path.append('/usr/local/trac/lib/python2.4/site-packages') from pkg_resources import require require("Trac==0.12multirepos-r7260") import trac.web.main application = trac.web.main.dispatch_request
Here my Sysinfo:
- Trac: 0.12multirepos-r7260
- Python: 2.4.4 (#1, Apr 15 2008, 23:37:53) [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]
- setuptools: 0.6c3
- SQLite: 3.3.8
- pysqlite: 2.3.2
- Genshi: 0.5
- Mercurial: 1.0.1
- jQuery: 1.2.3
And plugin info (everything is checked):
- Trac 0.12multirepos-r7260
- TracMercurial 0.12.0.3dev
- TracXMLRPC 1.0.0
Additional Info:
- Apache/2.2.3 with mod_wsgi 2.1
Attachments (0)
Change History (5)
comment:1 by , 16 years ago
Severity: | critical → major |
---|
comment:2 by , 16 years ago
comment:3 by , 16 years ago
Thank you osimons, it really was that error on my part. Added some documentation to the [TracModWSGI] page for clarification.
comment:5 by , 16 years ago
Component: | i18n → web frontend |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
Goodie. Closing as worksforyou
then :-)
Instead of:
try:
It makes it read the directory as 'setuptools-enabled', parsing .pth files and accessing the content of eggs in that path. Simply adding to sys.path will only find modules directly importable from that directory - which won't work for most egg installations.