Ticket #5677: 5677.diff

File 5677.diff, 1.9 KB (added by Tim Graham, 14 years ago)

updated patch, including new location of modpython.txt

  • docs/howto/deployment/modpython.txt

     
    153153When deploying Django sites on mod_python, you'll need to restart Apache each
    154154time you make changes to your Python code.
    155155
     156.. _mod_python documentation: http://modpython.org/live/current/doc-html/directives.html
     157
    156158Multiple Django installations on the same Apache
    157159================================================
    158160
     
    206208revoke your Django privileges.
    207209
    208210If you're the type of programmer who debugs using scattered ``print``
    209 statements, note that ``print`` statements have no effect in mod_python; they
    210 don't appear in the Apache log, as one might expect. If you have the need to
    211 print debugging information in a mod_python setup, either do this::
     211statements, note that writing to ``stdout`` with a regular ``print`` statement
     212is a bad idea.  Things written in this fashion will not appear in the Apache
     213log and may, with some WSGI hosting solutions, end up corrupting valid
     214output sent back to the client.
    212215
    213     assert False, the_value_i_want_to_see
     216If you have the need to print debugging information in a mod_python setup, you
     217have three options.  The first is to print to ``stderr`` explicitly, like so::
    214218
    215 Or add the debugging information to the template of your page.
     219    print >> sys.stderr, 'debug text'
     220    sys.stderr.flush()
    216221
    217 .. _mod_python documentation: http://modpython.org/live/current/doc-html/directives.html
     222Note that ``stderr`` is buffered, so calling ``flush`` is necessary if you wish
     223debugging information to be displayed promptly.
    218224
     225A second, more compact approach is to use an assertion::
     226
     227    assert False, 'debug text'
     228
     229The third option is to add debugging information to the template of your page.
     230
    219231.. _serving-media-files:
    220232
    221233Serving media files
Back to Top