summaryrefslogtreecommitdiff
path: root/docs/howto/deployment/modpython.txt
diff options
context:
space:
mode:
authorSimon Meers <simon@simonmeers.com>2010-10-09 05:08:42 +0000
committerSimon Meers <simon@simonmeers.com>2010-10-09 05:08:42 +0000
commitc93f5e5d0e530203048ddb6424ef43acabe17cf1 (patch)
tree1ed8ce5851c27a85b8eab22816e174bb8f4d807e /docs/howto/deployment/modpython.txt
parentb7a73cf9296a2629a45d4b303c2b9207d3c71c40 (diff)
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.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14059 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/howto/deployment/modpython.txt')
-rw-r--r--docs/howto/deployment/modpython.txt24
1 files changed, 18 insertions, 6 deletions
diff --git a/docs/howto/deployment/modpython.txt b/docs/howto/deployment/modpython.txt
index 90a85cac5c..3e413f9bce 100644
--- a/docs/howto/deployment/modpython.txt
+++ b/docs/howto/deployment/modpython.txt
@@ -158,6 +158,8 @@ the full URL.
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
================================================
@@ -211,15 +213,25 @@ everything for each request. But don't do that on a production server, or we'll
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'
+
+Another alternative is to add debugging information to the template of your page.
Serving media files
===================