Changes between Version 16 and Version 17 of PsycoMiddleware


Ignore:
Timestamp:
Oct 6, 2007, 8:09:59 PM (17 years ago)
Author:
Ludvig Ericson <ludvig.ericson@…>
Comment:

Added example of how to disable psyco automatically when DEBUG == True

Legend:

Unmodified
Added
Removed
Modified
  • PsycoMiddleware

    v16 v17  
    114114= Known problems =
    115115Psyco is great and you should look into it, but sometimes it can create weird problems (in conjunction with other software) that may be hard to debug. Please remember to turn it off when you have strange / not so obvious problems.
     116
     117To alleviate such problem, you could change `if plat...` to `if not settings.DEBUG and plat...`, having done `from django.conf import settings` first, short example
     118
     119{{{
     120#!python
     121from django.conf import settings
     122import psyco
     123import platform
     124import re
     125
     126if not settings.DEBUG and platform.architecture()[0] == '32bit':
     127    # Enable psyco, like earlier.
     128
     129# Define middleware, like earlier.
     130}}}
     131
     132This will simply disable psyco when you've got DEBUG set to True, which probably is a desirable effect.
Back to Top