Opened 14 years ago

Closed 14 years ago

Last modified 10 years ago

#16301 closed New feature (wontfix)

Show clients remote IP when running runserver

Reported by: jeyaseel@… Owned by: nobody
Component: Core (Other) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When running the dev-server (runserver), it would be nice to have the remote clients IP shown in the logs.

Fix:
In basehttp.py (django/core/servers), change this line in the log_message() method:

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)

Makes your log look like this:

[20/Jun/2011 14:32:13] (85.xx.xx.xx) "GET /full_list/ HTTP/1.1" 200 79

Change History (3)

comment:1 by Russell Keith-Magee, 14 years ago

Resolution: wontfix
Status: newclosed

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.

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.

comment:2 by cyberplant-django@…, 10 years ago

Hi!

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.

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.

What do you think?

comment:3 by Tim Graham, 10 years ago

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 DevelopersMailingList where you'll get more feedback than commenting on a closed ticket.

Note: See TracTickets for help on using tickets.
Back to Top