List Info

Thread: mod_python whoes




mod_python whoes
user name
2006-08-31 00:20:07

Kenneth Gonsalves wrote:
> On 30-Aug-06, at 3:35 PM, Frank Stüss wrote:
>
> > on a production server with mod_python, how can i
force reloading
> > all .py
> > files without restarting apache?
>
> you cant

To clarify, this is only the case where the Python code file
is loaded
by Django using its own methods for importing modules.

As far as mod_python itself goes, there are mechanisms for
having
code files it loads be reloaded when changed, but Django
isn't going
to use that feature of mod_python directly, as that then
means there
is an unwanted dependency on mod_python.

That said, for versions of mod_python < 3.3, the module
reloading
ability does have some problems. See:

  h
ttp://www.dscpl.com.au/articles/modpython-003.html

for details. Pretty well all of these issues are addressed
in yet to be
released mod_python 3.3 however.

Now it is probably technically feasible that Django could
harness the
improved module reloading abilities in mod_python 3.3 in
such a way
that it would be transparent and not cause a dependency in
user code
on mod_python, thus allowing you to be able to do what you
want, but
I tend to think that you would have a hard time getting such
a thing
added into Django. 

Graham


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python whoes
user name
2006-08-31 05:20:29
Thanks to you. 

So it is like it is. No short changes on a virtually hosted
production server 
with mod_python 

And my second problem doesn't belong in this list. After
googling again i 
found that it may be caused by a wrong compiled mod_python
(two mod_python 
versions with to python versions on the server). Very
strange behaviour: 
every other request apache complains about errors that have
been fixed 
sessions ago like missing templates or the like. The next
browser reload is 
ok and so on. Like mod_python sessions were cached even
after restarting 
apache and some requests got the 'wrong' mod_python
instance. Strange.

Have fun djangoing,
Frank




Am Donnerstag, 31. August 2006 02:20 schrieb Graham
Dumpleton:
> Kenneth Gonsalves wrote:
> > On 30-Aug-06, at 3:35 PM, Frank Stüss wrote:
> > > on a production server with mod_python, how
can i force reloading
> > > all .py
> > > files without restarting apache?
> >
> > you cant
>
> To clarify, this is only the case where the Python code
file is loaded
> by Django using its own methods for importing modules.
>
> As far as mod_python itself goes, there are mechanisms
for having
> code files it loads be reloaded when changed, but
Django isn't going
> to use that feature of mod_python directly, as that
then means there
> is an unwanted dependency on mod_python.
>
> That said, for versions of mod_python < 3.3, the
module reloading
> ability does have some problems. See:
>
>   h
ttp://www.dscpl.com.au/articles/modpython-003.html
>
> for details. Pretty well all of these issues are
addressed in yet to be
> released mod_python 3.3 however.
>
> Now it is probably technically feasible that Django
could harness the
> improved module reloading abilities in mod_python 3.3
in such a way
> that it would be transparent and not cause a dependency
in user code
> on mod_python, thus allowing you to be able to do what
you want, but
> I tend to think that you would have a hard time getting
such a thing
> added into Django. 
>
> Graham
>
>
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python whoes
user name
2006-08-31 07:01:52

Frank Stüss wrote:
> Thanks to you.
>
> So it is like it is. No short changes on a virtually
hosted production server
> with mod_python 
>
> And my second problem doesn't belong in this list.
After googling again i
> found that it may be caused by a wrong compiled
mod_python (two mod_python
> versions with to python versions on the server). Very
strange behaviour:
> every other request apache complains about errors that
have been fixed
> sessions ago like missing templates or the like. The
next browser reload is
> ok and so on. Like mod_python sessions were cached even
after restarting
> apache and some requests got the 'wrong' mod_python
instance. Strange.

I don't know what your other problem is, but it sounds like
what you
are
experiencing is that your requests are being serviced by
different
Apache
child processes. Further, that over time you made changes to
the code
base which either were wrong and caused an error with the
wrong code
then persisting in one process, or you renamed files
required by code
still loaded and in use by some other Apache child process.
In other
words,
different Apache child processes have different versions of
code
loaded.
Which of the child processes services a request is
essentially random
so
which error you see, or whether your code works is also
random.

The only way you will solve this when using Django is to
restart
Apache.

Making a module importing system that can handle automatic
module
reloading is quite hard and there are a lot of
considerations. I don't
know
too much about how Django is implemented, but the feeling I
get is that
even if they were to try and implement a proper module
reloading
system,
it would require some changes to how applications are
structured in
directories. This is in part because it is impossible to do
automatic
reloading on complex code which is organised as Python
packages. To
move Django away from using traditional Python packages
would mean
structural changes in user code which people aren't going
to want.

Graham


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python whoes
user name
2006-08-31 07:01:52

Frank Stüss wrote:
> Thanks to you.
>
> So it is like it is. No short changes on a virtually
hosted production server
> with mod_python 
>
> And my second problem doesn't belong in this list.
After googling again i
> found that it may be caused by a wrong compiled
mod_python (two mod_python
> versions with to python versions on the server). Very
strange behaviour:
> every other request apache complains about errors that
have been fixed
> sessions ago like missing templates or the like. The
next browser reload is
> ok and so on. Like mod_python sessions were cached even
after restarting
> apache and some requests got the 'wrong' mod_python
instance. Strange.

I don't know what your other problem is, but it sounds like
what you
are
experiencing is that your requests are being serviced by
different
Apache
child processes. Further, that over time you made changes to
the code
base which either were wrong and caused an error with the
wrong code
then persisting in one process, or you renamed files
required by code
still loaded and in use by some other Apache child process.
In other
words,
different Apache child processes have different versions of
code
loaded.
Which of the child processes services a request is
essentially random
so
which error you see, or whether your code works is also
random.

The only way you will solve this when using Django is to
restart
Apache.

Making a module importing system that can handle automatic
module
reloading is quite hard and there are a lot of
considerations. I don't
know
too much about how Django is implemented, but the feeling I
get is that
even if they were to try and implement a proper module
reloading
system,
it would require some changes to how applications are
structured in
directories. This is in part because it is impossible to do
automatic
reloading on complex code which is organised as Python
packages. To
move Django away from using traditional Python packages
would mean
structural changes in user code which people aren't going
to want.

Graham


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python whoes
user name
2006-08-31 08:23:21
Thanks again for anticipation.

The strange thing is: Apache *has* been restarted (as of
message of my 
provider). That's why i talked about a cache or something.
I found others 
experiencing this problem, too. We will see.

I totally agree that a special module reloading mechanism
doesn't belong into 
django code and i shurely can live with this (if the problem
mentioned is 
solved). If ever, it must be a middleware something which is
totally 
transparent to mod_python and django.

Greetings,
Frank

Am Donnerstag, 31. August 2006 09:01 schrieb Graham
Dumpleton:
> Frank Stüss wrote:
> > Thanks to you.
> >
> > So it is like it is. No short changes on a
virtually hosted production
> > server with mod_python 
> >
> > And my second problem doesn't belong in this
list. After googling again i
> > found that it may be caused by a wrong compiled
mod_python (two
> > mod_python versions with to python versions on the
server). Very strange
> > behaviour: every other request apache complains
about errors that have
> > been fixed sessions ago like missing templates or
the like. The next
> > browser reload is ok and so on. Like mod_python
sessions were cached even
> > after restarting apache and some requests got the
'wrong' mod_python
> > instance. Strange.
>
> I don't know what your other problem is, but it sounds
like what you
> are
> experiencing is that your requests are being serviced
by different
> Apache
> child processes. Further, that over time you made
changes to the code
> base which either were wrong and caused an error with
the wrong code
> then persisting in one process, or you renamed files
required by code
> still loaded and in use by some other Apache child
process. In other
> words,
> different Apache child processes have different
versions of code
> loaded.
> Which of the child processes services a request is
essentially random
> so
> which error you see, or whether your code works is also
random.
>
> The only way you will solve this when using Django is
to restart
> Apache.
>
> Making a module importing system that can handle
automatic module
> reloading is quite hard and there are a lot of
considerations. I don't
> know
> too much about how Django is implemented, but the
feeling I get is that
> even if they were to try and implement a proper module
reloading
> system,
> it would require some changes to how applications are
structured in
> directories. This is in part because it is impossible
to do automatic
> reloading on complex code which is organised as Python
packages. To
> move Django away from using traditional Python packages
would mean
> structural changes in user code which people aren't
going to want.
>
> Graham
>
>
> 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

mod_python whoes
user name
2006-08-31 10:31:52

Frank Stüss wrote:
> Thanks again for anticipation.
>
> The strange thing is: Apache *has* been restarted (as
of message of my
> provider). That's why i talked about a cache or
something. I found others
> experiencing this problem, too. We will see.

If you are using a service provider, ask them whether they
have setup
the
mod_python configuration such that your Django instance is
isolated
from
any other mod_python based or Django based application
instance.

This is mentioned in the Django installation notes for
mod_python at:

  http://www.djangoproject.com/documentation/modpython/

Specifically, ensure that the
"PythonInterpreter" directive is set to a
unique
name for your area of the URL namespace. If this isn't
done, then
another
web application could be interfering with yours.

> I totally agree that a special module reloading
mechanism doesn't belong into
> django code and i shurely can live with this (if the
problem mentioned is
> solved). If ever, it must be a middleware something
which is totally
> transparent to mod_python and django.

A module loading mechanism which supports reloading can't
be middleware
as
it needs to be intimately aware of the context it is used.
This is
because you
can't apply reloading to all modules, one can only do it
for a selected
subset
of modules. In mod_python this is those modules which make
up the web
application.

Graham


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )