Search code examples
djangomanage.py

Configuring the Django development server output


Is it possible to configure the output from the Django development server to show the IP address of the client making the request?


Solution

  • This in our list for "standard mods" to new Django releases. For Django 1.2.1, in django/core/servers/basehttp.py, line 614, change:

       msg = "[%s] %s\n" % (self.log_date_time_string(), format % args)
    

    to

       msg = "[%s] %s %s\n" % (self.log_date_time_string(),
                           self.client_address[0], format % args)