Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 3 and Version 4 of ModPythonIntegration


Ignore:
Timestamp:
10/24/05 17:49:50 (14 years ago)
Author:
leo mendoza
Comment:

removed mpcp specific instructions

Legend:

Unmodified
Added
Removed
Modified
  • ModPythonIntegration

    v3 v4  
    3434This method is supposed to have cherrypy production config stuff, but our prod.cfg file handles that, so make it a no-op. The better solution would be to remove the line in mpcp that looks for cherrysetup, but that's something I'll worry about when a push to production is near. 
    3535 
    36 '''THE FOLLOWING IS DATED. Go get the newest version of mpcp.py to fix these issues.''' 
    37  
    38 Now, in mpcp.py add the following lines, as per Robert's patch. 
    39 {{{ 
    40 #!python 
    41 ... 
    42 def handler(req): 
    43         config = req.get_config() 
    44         options = req.get_options() 
    45         setup(options) 
    46  
    47 +       # Create new threadlocal objects for the current request/response 
    48 +       cherrypy.request.purge__() 
    49 +       cherrypy.response.purge__() 
    50  
    51         # Vars needed by cherrypy 
    52         clientAddress = req.connection.remote_ip  
    53 ... 
    54 }}} 
    55  
    56 Also, in mpcp.py you may want to make the following change. In the current implementation, when an exception occurs it brings down the cherrypy server. But, because its persistent, it never gets brought back up. To fix this: 
    57 {{{ 
    58 #!python 
    59 def setup(options): 
    60            global _isSetup 
    61 ...             
    62 -          cherrypy.server.start(initOnly=True) 
    63 +          try: 
    64 +              cherrypy.server.start(initOnly=True) 
    65 +          except cherrypy.NotReady: 
    66 +              cherrypy.server.restart() 
    67 ... 
    68 }}} 
    69  
    70 I assume at some point, the mpcp will be changed to match the new CherryPy thread handling routine. The mpcp used for this mini HOWTO was 1.0... double check to see the purge requests aren't there already. 
     36Note: Previously, there were some instructions on how to get mpcp.py working with the new thread handling in CherryPy. Jamie seems to have updated mpcp to work with the new setup, so the instructions have been removed. I recommend getting the newest version to work with, instead of hacking up your local copy. 
    7137 
    7238Good luck!