Hi, I am 锁柱子 from the "improved wsgi script" blog post, thanks very
much Graeme for taking the time to look at this issue. I tried your
suggestions from the simplest first, running:

python manage.py shell
import comments
comments.__file__

produced the right results both with and without the "mysite"
prepended to the import path.

Then I added os.chdir('path/to/mysite') at the top of the wsgi script,
before anything else, but that didn't fix the problem.

So I logged the calls to globals(), locals(), sys.modules.keys() and
sys.modules['comments'].__file__ as you indicated, inside the
templatetags library that's exploding. There's a heck of a lot of
stuff in there so I won't paste everything unless necessary. Logging
this in the "broken" setup (without "mysite" prepended to the import
path), I noticed first of all that in both locals() and globals(),
__file__ pointed to the correct file, but __name__ pointed to
"django.templatetags.entry_tags". I don't know if django munges import
paths to make it look like all templatetag libraries are housed under
"django.templatetags", but this looked odd to me.

Nothing else immediately stood out. In sys.modules.keys() there are
the following comments-related entries, in the order they came out in
the list:

comments.forms
django.contrib.comments.views.utils
django.contrib.comments.views.django
mysite.comments.forms
django.contrib.comments.templatetags
comments.admin
django.contrib.comments
django.contrib.comments.views.textwrap
mysite.comments.comments
django.contrib.comments.forms
comments.common
django.contrib.comments.views.comments
django.contrib.comments.time
django.contrib.comments.datetime
comments.comments
django.contrib.comments.admin
django.contrib.comments.signals
comments.pickle
django.contrib.comments.views.moderation
comments.django
django.contrib.comments.feeds
comments.datetime
django.contrib.comments.models
mysite.comments
myapp.comments
mysite.comments.django
comments
django.contrib.comments.managers
django.contrib.comments.views
django.contrib.comments.views.urllib
comments.akismet
django.contrib.comments.django
comments.models

The one "myapp" entry is the app that has the exploding templatetags
library.

I really have no idea if this is what I should be seeing or not...

Thanks again for your help!

Eric

PS This is with the new and improved wsgi script in place, so the only
thing I'm adding to sys.path is the path that ends in "mysite".

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to