Skip to content

Commit

Permalink
Merge pull request #3356 from evandam/master
Browse files Browse the repository at this point in the history
Display hostname when running remotely
  • Loading branch information
minrk authored Feb 27, 2018
2 parents 02d6cd5 + 4eceb84 commit b66a60d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions notebook/notebookapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,11 @@ def init_webapp(self):

@property
def display_url(self):
ip = self.ip if self.ip else _('[all ip addresses on your system]')
hostname = socket.gethostname()
if self.ip in ('localhost', '127.0.0.1', hostname):
ip = self.ip
else:
ip = hostname
url = self._url(ip)
if self.token:
# Don't log full token if it came from config
Expand Down Expand Up @@ -1625,7 +1629,7 @@ def start(self):
'\n',
'Copy/paste this URL into your browser when you connect for the first time,',
'to login with a token:',
' %s' % url_concat(self.connection_url, {'token': self.token}),
' %s' % url_concat(self.display_url, {'token': self.token}),
]))

self.io_loop = ioloop.IOLoop.current()
Expand Down

0 comments on commit b66a60d

Please sign in to comment.