From a2bda47a2168eadaa693b1019f4111559c7138bd Mon Sep 17 00:00:00 2001 From: Daniel Butler Date: Fri, 22 May 2020 19:36:54 -0400 Subject: [PATCH 1/2] adding additional readme warning for using docker https://gist.github.com/douglasmiranda/9de51aaba14543851ca3#file-option2-py --- docs/installation.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/installation.rst b/docs/installation.rst index b2e8bcacd..a4c0ceb01 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -102,3 +102,15 @@ settings module:: You can change the logic of determining whether or not the Debug Toolbar should be shown with the :ref:`SHOW_TOOLBAR_CALLBACK ` option. This option allows you to specify a custom function for this purpose. + +.. warning:: + + If using Docker the following will set your internal ips correctly only if you are in Debug mode.:: + + if DEBUG: + import os # only if you haven't already imported this + import socket # only if you haven't already imported this + hostname, _, ips = socker.gethostbyname_ex(socket.gethostname()) + INTERNAL_IPS = [ip[:-1] + '1' for ip in ips] + ['127.0.0.1', '10.0.2.2'] + + From 708e7007dfa7379e00956b452a05bc8043c5b045 Mon Sep 17 00:00:00 2001 From: sarath ak Date: Sun, 22 Aug 2021 15:36:52 +0530 Subject: [PATCH 2/2] Update installation.rst fixed spelling error --- docs/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index cfca831a8..01061fb11 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -100,7 +100,7 @@ option. This option allows you to specify a custom function for this purpose. .. warning:: - If using Docker the following will set your internal ips correctly only if you are in Debug mode.:: + If using Docker the following will set your `INTERNAL_IPS` correctly only if you are in Debug mode.:: if DEBUG: import os # only if you haven't already imported this