Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #161 -- Log output for 'django-admin runserver' no longer inclu…

…des admin media

git-svn-id: http://code.djangoproject.com/svn/django/trunk@320 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8a86e7713f26f6e91a9a25615073321b9dd842eb 1 parent ba3db4c
Adrian Holovaty authored July 26, 2005

Showing 1 changed file with 12 additions and 0 deletions. Show diff stats Hide diff stats

  1. 12  django/core/servers/basehttp.py
12  django/core/servers/basehttp.py
@@ -530,6 +530,12 @@ def set_app(self,application):
530 530
 
531 531
 class WSGIRequestHandler(BaseHTTPRequestHandler):
532 532
     server_version = "WSGIServer/" + __version__
  533
+
  534
+    def __init__(self, *args, **kwargs):
  535
+        from django.conf.settings import ADMIN_MEDIA_PREFIX
  536
+        self.admin_media_prefix = ADMIN_MEDIA_PREFIX
  537
+        BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  538
+
533 539
     def get_environ(self):
534 540
         env = self.server.base_environ.copy()
535 541
         env['SERVER_PROTOCOL'] = self.request_version
@@ -579,6 +585,12 @@ def handle(self):
579 585
         handler.request_handler = self      # backpointer for logging
580 586
         handler.run(self.server.get_app())
581 587
 
  588
+    def log_message(self, format, *args):
  589
+        # Don't bother logging requests for admin images or the favicon.
  590
+        if self.path.startswith(self.admin_media_prefix) or self.path == '/favicon.ico':
  591
+            return
  592
+        sys.stderr.write("[%s] %s\n" % (self.log_date_time_string(), format % args))
  593
+
582 594
 def run(port, wsgi_handler):
583 595
     server_address = ('', port)
584 596
     httpd = WSGIServer(server_address, WSGIRequestHandler)

0 notes on commit 8a86e77

Please sign in to comment.
Something went wrong with that request. Please try again.