mod_wsgi error

1 view
Skip to first unread message

zaf

unread,
May 7, 2008, 3:51:23 AM5/7/08
to TurboGears
Hi, I've been trying to deploy my Turbogears web app
with mod_wsgi, following the instructions on this page :

http://code.google.com/p/modwsgi/wiki/IntegrationWithTurboGears

but when I access it in my browser I get the following error page :
http://pastebin.com/m26db19c7
Can anyone tell me what I'm doing wrong ?

here's my wsgi script :

http://pastebin.com/m5efb0824

My app works fine when I start it using the start-myapp.py script.
I renamed the Root class in my controller as Cinego and that class is
a subclass of the WebServiceRoot class, which is why there is a
"http://localhost/" url in the constructor.

and since I've been told that there could be some package version
error, here's what I get from tg-admin info :

http://pastebin.com/m29f5fa6b


Thanks I could really use some help.
Tom

zaf

unread,
May 7, 2008, 6:24:00 AM5/7/08
to TurboGears
Okay so I figured out where the problem seems to come from.
Apparently loading this is the line in the app.cfg file that causes
the problem :

tg.include_widgets = ['jquery.jquery', 'turbogears.jsi18nwidget']

Now I have tried with both widgets individually and it just so happens
that the turbogears.jsi18nwidget is the cause. This is, unless I'm
mistaken, the widget for localizing Javascript files.
I really need it though since my app is supposed to be in at least two
different languages and I've used it for the translation so far. is
there any reason it's inclusion should cause problems ?

Anyone has had this issue before ?
Tom

zaf

unread,
May 7, 2008, 11:24:28 AM5/7/08
to TurboGears
I've also noticed that if I work around this problem by including the
i18n-base.js file directly in the template it works. However, my
internationalization doesn't work anymore I'm stuck in one language
which is amazingly strange. It looks like it won't find the message.po
files. the _() methods seems to work but returns what's given to it as
far as I can tell.
I'm really confused, does anyone have any idea what I might be
missing ?

Diez B. Roggisch

unread,
May 7, 2008, 12:10:19 PM5/7/08
to turbo...@googlegroups.com
On Wednesday 07 May 2008 17:24:28 zaf wrote:
> I've also noticed that if I work around this problem by including the
> i18n-base.js file directly in the template it works. However, my
> internationalization doesn't work anymore I'm stuck in one language
> which is amazingly strange. It looks like it won't find the message.po
> files. the _() methods seems to work but returns what's given to it as
> far as I can tell.
> I'm really confused, does anyone have any idea what I might be
> missing ?

This is obvious - if you include the js yourself, the _() is available.
However what seems to be missing is the messages-<lang>.js that defines the
actual translations.

On the *why* I can't even speculate. I've written the js18nwidget in the same
way I did with every other widget, and fail to see how serving it as dynamic
content can cause such a ruckus.

are other tg_widgets served properly, e.g. mochikit and stuff?

Diez

zaf

unread,
May 7, 2008, 12:30:58 PM5/7/08
to TurboGears
I'm using the jquery.jquery widget in the same app.cfg file and it
works fine. I tried replacing it with mochikit and that works too.

what you said is obvious of course, I've been working on this issue
for two days now and I just can't seem to think straight on it
anymore.
it won't find the regular internationalization either ie, the one that
was defined in the templates so I'm not even sure the problem is with
the widget (well maybe it is but maybe it's just a consequence), I'm
afraid it is with the entire i18n package. I just can't seem to figure
out why. it's as if those files couldn't be found for some reason.
I'm really losing my mind over this. The main reason I want to deploy
it with mod_wsgi is to be able to use mod_ssl in apache as well. Would
I be better of using mod_rewrite ?
I feel like I'm really close to have it working, it's a bit
frustrating.
Thanks
Tom

mbertoldi

unread,
May 7, 2008, 2:19:01 PM5/7/08
to TurboGears
Hi, try checking your permissions (e.g. is /home/tom/cinego/python-
eggs writable for apache user?)

Michele.

Diez B. Roggisch

unread,
May 8, 2008, 11:25:36 AM5/8/08
to turbo...@googlegroups.com
On Wednesday 07 May 2008 18:30:58 zaf wrote:
> I'm using the jquery.jquery widget in the same app.cfg file and it
> works fine. I tried replacing it with mochikit and that works too.
>
> what you said is obvious of course, I've been working on this issue
> for two days now and I just can't seem to think straight on it
> anymore.
> it won't find the regular internationalization either ie, the one that
> was defined in the templates so I'm not even sure the problem is with
> the widget (well maybe it is but maybe it's just a consequence), I'm
> afraid it is with the entire i18n package. I just can't seem to figure
> out why. it's as if those files couldn't be found for some reason.
> I'm really losing my mind over this. The main reason I want to deploy
> it with mod_wsgi is to be able to use mod_ssl in apache as well. Would
> I be better of using mod_rewrite ?
> I feel like I'm really close to have it working, it's a bit
> frustrating.

I'm currently fighting an uphill battle with mod_wsgi myself. Once that it is
settled, I'll try & see if I can reproduce that behavior myself.

Diez

zaf

unread,
May 8, 2008, 1:45:57 PM5/8/08
to TurboGears
Yeah I had that problem but solved it.
Really it seems like it just won't "handle" internationalization for a
reason.

zaf

unread,
May 9, 2008, 7:58:43 AM5/9/08
to TurboGears
ok so thanks to Graham in the mod_wsgi mailing list I figured out what
the problem was.
I needed to add this line in the apache conf file :

WSGIDaemonProcess site-1 threads=25 home=myappdirectory

Bascially I guess it didn't start from the right directory and
couldn't find the internationalization files properly.
Well thanks for all the help. I do wonder why this only affected the
internationalization package and not the rest of the app...

Florent Aide

unread,
May 9, 2008, 8:07:36 AM5/9/08
to turbo...@googlegroups.com
This is interesting indeed....

Diez, do you know of any place where you would have asserted a
relative path for finding the files ?

Florent.

Reply all
Reply to author
Forward
0 new messages