Ticket #5677: 5677_modpython.diff
File 5677_modpython.diff, 1.8 KB (added by , 14 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; they210 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, as one might expect. 212 214 213 assert False, the_value_i_want_to_see 215 If you have the need to print debugging information in a mod_python setup, you 216 have three options. The first is to print to ``stderr`` explicitly, like so:: 214 217 215 Or add the debugging information to the template of your page. 218 print >> sys.stderr, 'debug text' 219 sys.stderr.flush() 216 220 217 .. _mod_python documentation: http://modpython.org/live/current/doc-html/directives.html 221 Note that ``stderr`` is buffered, so calling ``flush`` is necessary if you wish 222 debugging information to be displayed promptly. 218 223 224 A second, more compact approach is to use an assertion:: 225 226 assert False, 'debug text' 227 228 The third option is to add debugging information to the template of your page. 229 219 230 .. _serving-media-files: 220 231 221 232 Serving media files