Ticket #5677: 5677.diff
File 5677.diff, 1.9 KB (added by , 15 years ago) |
---|
-
docs/howto/deployment/modpython.txt
153 153 When deploying Django sites on mod_python, you'll need to restart Apache each 154 154 time you make changes to your Python code. 155 155 156 .. _mod_python documentation: http://modpython.org/live/current/doc-html/directives.html 157 156 158 Multiple Django installations on the same Apache 157 159 ================================================ 158 160 … … 206 208 revoke your Django privileges. 207 209 208 210 If 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:: 211 statements, note that writing to ``stdout`` with a regular ``print`` statement 212 is a bad idea. Things written in this fashion will not appear in the Apache 213 log and may, with some WSGI hosting solutions, end up corrupting valid 214 output sent back to the client. 212 215 213 assert False, the_value_i_want_to_see 216 If you have the need to print debugging information in a mod_python setup, you 217 have three options. The first is to print to ``stderr`` explicitly, like so:: 214 218 215 Or add the debugging information to the template of your page. 219 print >> sys.stderr, 'debug text' 220 sys.stderr.flush() 216 221 217 .. _mod_python documentation: http://modpython.org/live/current/doc-html/directives.html 222 Note that ``stderr`` is buffered, so calling ``flush`` is necessary if you wish 223 debugging information to be displayed promptly. 218 224 225 A second, more compact approach is to use an assertion:: 226 227 assert False, 'debug text' 228 229 The third option is to add debugging information to the template of your page. 230 219 231 .. _serving-media-files: 220 232 221 233 Serving media files