Django

Code

Changeset 2239

Show
Ignore:
Timestamp:
02/03/06 09:18:20 (3 years ago)
Author:
adrian
Message:

Fixed #1323 -- Added ENABLE_PSYCO. Thanks, Wojtek.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/conf/global_settings.py

    r2133 r2239  
    188188TIME_FORMAT = 'P' 
    189189 
     190# Whether to enable Psyco, which optimizes Python code. Requires Psyco. 
     191# http://psyco.sourceforge.net/ 
     192ENABLE_PSYCO = False 
     193 
    190194############## 
    191195# MIDDLEWARE # 
  • django/trunk/django/core/handlers/modpython.py

    r1500 r2239  
    131131        from django.core import db 
    132132 
     133        if settings.ENABLE_PSYCO: 
     134            import psyco 
     135            psyco.profile() 
     136 
    133137        # if we need to set up middleware, now that settings works we can do it now. 
    134138        if self._request_middleware is None: 
  • django/trunk/django/core/handlers/wsgi.py

    r1442 r2239  
    146146        from django.core import db 
    147147 
     148        if settings.ENABLE_PSYCO: 
     149            import psyco 
     150            psyco.profile() 
     151 
    148152        # Set up middleware if needed. We couldn't do this earlier, because 
    149153        # settings weren't available. 
  • django/trunk/docs/settings.txt

    r1925 r2239  
    343343or ``django.core.mail.mail_managers``. You'll probably want to include the 
    344344trailing space. 
     345 
     346ENABLE_PSYCO 
     347------------ 
     348 
     349Default: ``False`` 
     350 
     351**New in Django development version.** 
     352 
     353Whether to enable Psyco, which optimizes Python code. Requires Psyco_. 
     354 
     355.. _Psyco: http://psyco.sourceforge.net/ 
    345356 
    346357IGNORABLE_404_ENDS