diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index ebc7d08610..bc1a6e9430 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -30,7 +30,7 @@ New features: - The files list now shows file sizes (:ghpull:`3539`) - Add a quit button in the dashboard (:ghpull:`3004`) -- Display hostname in the terminal when running remotely (:ghpull:`3356`) +- Display hostname in the terminal when running remotely (:ghpull:`3356`, :ghpull:`3593`) - Add slides exportation/download to the menu (:ghpull:`3287`) - Add any extra installed nbconvert exporters to the "Download as" menu (:ghpull:`3323`) - Editor: warning when overwriting a file that is modified on disk (:ghpull:`2783`) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index 2be2b92b9c..e1db9d879e 100755 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -1339,11 +1339,10 @@ def init_webapp(self): @property def display_url(self): - hostname = socket.gethostname() - if self.ip in ('localhost', '127.0.0.1', hostname): - ip = self.ip + if self.ip in ('', '0.0.0.0'): + ip = socket.gethostname() else: - ip = hostname + ip = self.ip url = self._url(ip) if self.token: # Don't log full token if it came from config