Ticket #5677: modpython.diff
File modpython.diff, 1.9 KB (added by , 17 years ago) |
---|
-
docs/modpython.txt
114 114 When deploying Django sites on mod_python, you'll need to restart Apache each 115 115 time you make changes to your Python code. 116 116 117 .. _mod_python documentation: http://modpython.org/live/current/doc-html/directives.html 118 117 119 Multiple Django installations on the same Apache 118 120 ================================================ 119 121 … … 166 168 revoke your Django privileges. 167 169 168 170 If you're the type of programmer who debugs using scattered ``print`` 169 statements, note that ``print`` statements have no effect in mod_python; they 170 don't appear in the Apache log, as one might expect. If you have the need to 171 print debugging information in a mod_python setup, either do this:: 171 statements, note that writing to ``stdout`` with a regular ``print`` statement 172 is a bad idea. Things written in this fashion will not appear in the Apache 173 log and may, with some WSGI hosting solutions, end up corrupting valid 174 output sent back to the client. 172 175 173 assert False, the_value_i_want_to_see 176 If you have the need to print debugging information in a mod_python setup, 177 then you have three options. The first is to print to ``stderr`` explicitly, 178 like so:: 174 179 175 Or add the debugging information to the template of your page. 180 print >> sys.stderr, 'debug text' 181 sys.stderr.flush() 176 182 177 .. _mod_python documentation: http://modpython.org/live/current/doc-html/directives.html 183 Note that ``stderr`` is buffered, so calling ``flush`` is necessary if you 184 wish debugging information to be displayed promptly. 178 185 186 A second, more compact approach is to use an assertion:: 187 188 assert False, 'debug text' 189 190 The third option is to add debugging information to the template of your page. 191 179 192 Serving media files 180 193 =================== 181 194