2

I have a question now. I want to hide out the message by django server such as 'get /index.html...', that is the response to client side. How can I do it?

liao
  • 65
  • 1
  • 1
  • 8
  • I don't know the answer but, I'm really curious on why you would want to impose such behaviour ? – Jonas Geiregat Aug 30 '12 at 06:47
  • you want for development server that comes with django? – Rohan Aug 30 '12 at 06:47
  • If you're talking about apache verbosity, have a look at http://www.webreference.com/programming/Apache-Logging/index.html – Hedde van der Heide Aug 30 '12 at 06:50
  • Thx. I have a django_socketio server that handles instant messages, I want to hide the messages because maybe it's more efficient and what's most important is that when I type cmd in it, I won't be interrupted by the messages. Does that make sense? – liao Aug 30 '12 at 06:57

1 Answers1

2

Hiding development server's messages is not supported directly by django, but you can do that by modifying django's code. Just open file:

[PYTHON site-packages]/django/core/servers/basehttp.py

in a text editor and comment the line (line 200 in django 1.4.1):

sys.stderr.write(msg)

and to find python site packages, you can type this in a terminal (cmd):

python -c "import sys; sys.path = sys.path[1:]; import django; print(django.__path__)"
Amir Ali Akbari
  • 5,973
  • 5
  • 35
  • 47