Django: Ticket #16301: Show clients remote IP when running runserverhttps://code.djangoproject.com/ticket/16301
<p>
When running the dev-server (runserver), it would be nice to have the remote clients IP shown in the logs.
</p>
<p>
Fix:
In basehttp.py (django/core/servers), change this line in the log_message() method:
</p>
<blockquote>
<p>
msg = "[%s] %s\n" % (self.log_date_time_string(), format % args)
</p>
</blockquote>
<p>
to:
</p>
<blockquote>
<p>
msg = "[%s] (%s) %s\n" % (self.log_date_time_string(), self.client_address<a class="changeset" href="https://code.djangoproject.com/changeset/0/">[0]</a>, format % args)
</p>
</blockquote>
<p>
Makes your log look like this:
</p>
<blockquote>
<p>
<a class="missing changeset" title="No changeset 20 in the repository">[20/Jun/2011 14:32:13]</a> (85.xx.xx.xx) "GET /full_list/ HTTP/1.1" 200 79
</p>
</blockquote>
en-usDjangohttps://www.djangoproject.com/s/img/site/hdr_logo.gifhttps://code.djangoproject.com/ticket/16301
Trac 1.2.2Russell Keith-MageeMon, 20 Jun 2011 13:14:48 GMTstatus changed; resolution sethttps://code.djangoproject.com/ticket/16301#comment:1
https://code.djangoproject.com/ticket/16301#comment:1
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>wontfix</em>
</li>
</ul>
<p>
Marking this wontfix. If you're developing, there should only be one person hitting the server -- you --so the IP address of the requesting user should be well known. Including the IP address sounds to me like something you only need if you're exposing the development server to real traffic, which you shouldn't be doing. We deliberately hobble the development server to make it difficult (or impractical) to use it as a deployment server.
</p>
<p>
If you can make a strong counterargument for why the IP should be included, feel free to start a discussion on django-developers about this idea.
</p>
Ticketcyberplant-django@…Thu, 03 Jul 2014 10:08:44 GMThttps://code.djangoproject.com/ticket/16301#comment:2
https://code.djangoproject.com/ticket/16301#comment:2
<p>
Hi!
</p>
<p>
Sorry for reviving this old issue. In my case I'm developing locally with my notebook, and the server is processing requests from my notebook, my tablet and my chromecast.
</p>
<p>
It would be handy to know which device did which requests. Now I'm getting duplicated requests and don't know which device is doing that.
</p>
<p>
What do you think?
</p>
TicketTim GrahamThu, 03 Jul 2014 17:16:41 GMThttps://code.djangoproject.com/ticket/16301#comment:3
https://code.djangoproject.com/ticket/16301#comment:3
<p>
My first reaction is that it would add a lot of noise to the logs for most people who don't care about the IP. As noted in comment 1, you should bring the discussion to the <a class="wiki" href="https://code.djangoproject.com/wiki/DevelopersMailingList">DevelopersMailingList</a> where you'll get more feedback than commenting on a closed ticket.
</p>
Ticket