473,394 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

MOD_PYTHON + packages reloading

Hello,

I came across annoying problem during my fun with mod_python. I turned
out that mod_python load package only onca and don't care about any
changes to it. Obviously it makes sense on production server but
during development is more then annoying. I find a way to reload my
module:

m = apache.import_module(name)
reload(m)

But this solution doesn't satisfy my. Is there any way to use old good
import x.x.x or from x.x.x import y and somehow set mod_python to
autoreload packages? apache.import_module(name,autoreload=1) didn't
work.
What is more interesting if a file is in the same directory (no in the
package) i don't need to wory about reloading, python doesn't cache
it.

Please help me :)

Oct 18 '07 #1
1 1513
lu********@gmail.com wrote:
I came across annoying problem during my fun with mod_python. I turned
out that mod_python load package only onca and don't care about any
changes to it. Obviously it makes sense on production server but
during development is more then annoying.
Have you read the mod_python manual?

http://www.modpython.org/live/curren...other-par.html

5.4.8 PythonAutoReload

Syntax: PythonAutoReload {On, Off}
Default: PythonAutoReload On
Context: server config, virtual host, directory, htaccess
Override: not None
Module: mod_python.c

If set to Off, instructs mod_python not to check the modification date
of the module file.

By default, mod_python checks the time-stamp of the file and reloads the
module if the module's file modification date is later than the last
import or reload. This way changed modules get automatically reimported,
eliminating the need to restart the server for every change.

Disabling autoreload is useful in production environment where the
modules do not change; it will save some processing time and give a
small performance gain.

Oct 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Python_it | last post by:
I'm going to work with mod_python. I install mod_python 3.2.2b for python 2.4. If i test my install with mptest.py see this link:...
6
by: Little | last post by:
I can't figure out how to build this type of program using the publisher handler. I have the following connected to the program SetHandler python-program PythonHandler mod_python.publisher...
2
by: exhuma.twn | last post by:
Hi again, as soon as I try to make use of the "session" object inside a psp-template file, I get the following error: Mod_python error: "PythonHandler mod_python.publisher" Traceback (most...
1
by: | last post by:
I have an application that runs on mod_python/apache using the publisher handler. It uses an access db as the backend and connects via ADO. In a test environment on XP it runs fine, but when on a...
0
by: Manuzhai | last post by:
Hello there, I have this weird problem with a mod_python application. Recently I installed ElementTree and cElementTree through ez_setup.py, even though they were already installed normally...
3
by: joe jacob | last post by:
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I added <Directory...
2
by: Aaron Scott | last post by:
I've installed mod_python, and everything seems to be working, but it fails when I try to import another file into the file that's actually producing the output. I have these lines at the top of...
0
by: Simo D | last post by:
Hi, I'm using a script.py to write a file in a dir on the server. Mod_python work but i get: Mod_python error: "PythonHandler mod_python.publisher" Traceback (most recent call last): File...
0
by: Simo D | last post by:
Ok, solved: apache is unable to follow relative paths from the script. Putting ol absolute paths it's ok! Simo D wrote: -- View this message in context:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.