Fixed #1323 -- Added ENABLE_PSYCO. Thanks, Wojtek.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
bd41a51942
commit
567e4e4411
|
@ -187,6 +187,10 @@ DATETIME_FORMAT = 'N j, Y, P'
|
||||||
# http://www.djangoproject.com/documentation/templates/#now
|
# http://www.djangoproject.com/documentation/templates/#now
|
||||||
TIME_FORMAT = 'P'
|
TIME_FORMAT = 'P'
|
||||||
|
|
||||||
|
# Whether to enable Psyco, which optimizes Python code. Requires Psyco.
|
||||||
|
# http://psyco.sourceforge.net/
|
||||||
|
ENABLE_PSYCO = False
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# MIDDLEWARE #
|
# MIDDLEWARE #
|
||||||
##############
|
##############
|
||||||
|
|
|
@ -130,6 +130,10 @@ class ModPythonHandler(BaseHandler):
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core import db
|
from django.core import db
|
||||||
|
|
||||||
|
if settings.ENABLE_PSYCO:
|
||||||
|
import psyco
|
||||||
|
psyco.profile()
|
||||||
|
|
||||||
# if we need to set up middleware, now that settings works we can do it now.
|
# if we need to set up middleware, now that settings works we can do it now.
|
||||||
if self._request_middleware is None:
|
if self._request_middleware is None:
|
||||||
self.load_middleware()
|
self.load_middleware()
|
||||||
|
|
|
@ -145,6 +145,10 @@ class WSGIHandler(BaseHandler):
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core import db
|
from django.core import db
|
||||||
|
|
||||||
|
if settings.ENABLE_PSYCO:
|
||||||
|
import psyco
|
||||||
|
psyco.profile()
|
||||||
|
|
||||||
# Set up middleware if needed. We couldn't do this earlier, because
|
# Set up middleware if needed. We couldn't do this earlier, because
|
||||||
# settings weren't available.
|
# settings weren't available.
|
||||||
if self._request_middleware is None:
|
if self._request_middleware is None:
|
||||||
|
|
|
@ -343,6 +343,17 @@ Subject-line prefix for e-mail messages sent with ``django.core.mail.mail_admins
|
||||||
or ``django.core.mail.mail_managers``. You'll probably want to include the
|
or ``django.core.mail.mail_managers``. You'll probably want to include the
|
||||||
trailing space.
|
trailing space.
|
||||||
|
|
||||||
|
ENABLE_PSYCO
|
||||||
|
------------
|
||||||
|
|
||||||
|
Default: ``False``
|
||||||
|
|
||||||
|
**New in Django development version.**
|
||||||
|
|
||||||
|
Whether to enable Psyco, which optimizes Python code. Requires Psyco_.
|
||||||
|
|
||||||
|
.. _Psyco: http://psyco.sourceforge.net/
|
||||||
|
|
||||||
IGNORABLE_404_ENDS
|
IGNORABLE_404_ENDS
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue