Adrian Holovaty wrote:
On 1/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> here what I've got from my Apache2 error log:
>
> [Thu Jan 04 16:07:57 2007] [notice] mod_python: (Re)importing module
> 'django.core.handlers.modpython'
> [Thu Jan 04 16:08:06 2007] [notice] mod_python: (Re)importing module
> 'django.core.handlers.modpython'
> [Thu Jan 04 16:34:15 2007] [notice] mod_python: (Re)importing module
> 'django.core.handlers.modpython'
> ....
>
> I was wondering what could be the reason of it ?

Hello,

I've seen this Apache notice too, and I'm not sure what it is, but
it's never caused any problems for me. :)

With that said, I would be grateful if anybody could explain why that
happens, and if we need to change something on Django's end so that,
at the very least, people's logfiles won't get cluttered with this.

These messages are generally quite normal. You will see the message the
first time that Django module is imported for each Python interpreter
instance in which it is used. Since on UNIX there can be multiple
Apache child processes, you will see one for each child process
created. This will normally be seen at Apache startup, but it might
occur later as well as Apache decides to create additional child
processes. Even for the same child process, you might see the message
more than once if someone is running multiple Django instances within
distinct named Python interpreters.

You can eliminate the messages by ensuring you have:

 PythonDebug Off

in the Apache configuration file, something that is recommended for
production systems so that stack traces don't get displayed in web
pages if Python code raises an exception which isn't caught and dealt
with.

BTW, in mod_python 3.3, it will show the process ID against these
messages and distinguish an initial import and a reload. Ultimately
though that will not matter for Django anyway, as in 3.3, mod_python
will not try and load standard packages/modules on sys.path itself and
will defer to standard Python module importer and so no message will be
displayed as mod_python isn't loading it.

FWIW, it amazes me sometimes that although Django can be made to work
on mod_python that very few if any Django developers I have seen
exhibit any real knowledge about how Apache/mod_python works. As a
consequence I keep seeing incorrect statements and advice being made
about mod_python on lists and also in Django documentation. These
problems extend to there also being some potentially questionable code
in the mod_python adaptor for Django as well. Although I have pointed
out at times that what is being said doesn't make sense or is wrong, no
one seems to make an attempt to address it.

Graham

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to