Author: DrMeers
Date: 2010-10-09 00:10:32 -0500 (Sat, 09 Oct 2010)
New Revision: 14060

Modified:
   django/branches/releases/1.2.X/docs/howto/deployment/modpython.txt
Log:
[1.2.X] Fixed #5677 -- update modpython stdout documentation. Thanks to Manfred 
Wassmann for the report, nickefford for the initial patch and Graham Dumpleton 
for the expert advice.

Backported of r14059 from trunk.


Modified: django/branches/releases/1.2.X/docs/howto/deployment/modpython.txt
===================================================================
--- django/branches/releases/1.2.X/docs/howto/deployment/modpython.txt  
2010-10-09 05:08:42 UTC (rev 14059)
+++ django/branches/releases/1.2.X/docs/howto/deployment/modpython.txt  
2010-10-09 05:10:32 UTC (rev 14060)
@@ -2,6 +2,13 @@
 How to use Django with Apache and mod_python
 ============================================
 
+.. warning::
+
+    Support for mod_python will be deprecated in a future release of Django. If
+    you are configuring a new deployment, you are strongly encouraged to
+    consider using :doc:`mod_wsgi </howto/deployment/modwsgi>` or any of the
+    other :doc:`supported backends </howto/deployment/index>`.
+
 .. highlight:: apache
 
 The `mod_python`_ module for Apache_ can be used to deploy Django to a
@@ -151,6 +158,8 @@
 When deploying Django sites on mod_python, you'll need to restart Apache each
 time you make changes to your Python code.
 
+.. _mod_python documentation: 
http://modpython.org/live/current/doc-html/directives.html
+
 Multiple Django installations on the same Apache
 ================================================
 
@@ -204,17 +213,25 @@
 revoke your Django privileges.
 
 If you're the type of programmer who debugs using scattered ``print``
-statements, note that ``print`` statements have no effect in mod_python; they
-don't appear in the Apache log, as one might expect. If you have the need to
-print debugging information in a mod_python setup, either do this::
+statements, note that output to ``stdout`` will not appear in the Apache
+log and can even `cause response errors`_.
 
-    assert False, the_value_i_want_to_see
+.. _cause response errors: 
http://blog.dscpl.com.au/2009/04/wsgi-and-printing-to-standard-output.html
 
-Or add the debugging information to the template of your page.
+If you have the need to print debugging information in a mod_python setup, you 
+have a few options. You can print to ``stderr`` explicitly, like so::
+ 
+    print >> sys.stderr, 'debug text'
+    sys.stderr.flush()
+ 
+(note that ``stderr`` is buffered, so calling ``flush`` is necessary if you 
wish
+debugging information to be displayed promptly.)
+ 
+A more compact approach is to use an assertion::
 
-.. _mod_python documentation: 
http://modpython.org/live/current/doc-html/directives.html
+    assert False, 'debug text'
 
-.. _serving-media-files:
+Another alternative is to add debugging information to the template of your 
page.
 
 Serving media files
 ===================
@@ -267,10 +284,6 @@
 .. _Apache: http://httpd.apache.org/
 .. _Cherokee: http://www.cherokee-project.com/
 
-.. _howto-deployment-modpython-serving-the-admin-files:
-
-.. _serving-the-admin-files:
-
 Serving the admin files
 =======================
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to