ERR_CONNECTION_REFUSED via localhost access

152 views
Skip to first unread message

jagder

unread,
Feb 5, 2021, 9:15:27 AM2/5/21
to Django users
I have no idea my problem is fit in here "Django user community", however I tried to send question. 

I made dev environment under below.
# Container is Docker container.
background.jpg

I made dev environment under below.
# Container is Docker container.

background.jpg
I made 1 server for backend "Django" in container.
I made 3 server for frontend "Flask"(for test), "nodejs"(for test), "React + nodejs" in container.


From "React + nodejs" srv to "Django" srv,
I couldn't access using 'http://localhost:8040/' or 'http://127.0.0.1:8040/'( both err = ERR_CONNECTION_REFUSED )
I could access only using 'http://10.128.130.47:8040/'

From "Flask" srv or "nodejs" srv to "Django" srv,
I could access using 'http://localhost:8040/' and 'http://127.0.0.1:8040/'


Are there any limitation or setting problem in Django access via localhost(or 127.0.0.1 )?

//----------------------------------------------------
Dnago srv setting.
[settings.py]
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = [
'corsheaders',
....
]
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
....
]
CORS_ORIGIN_ALLOW_ALL  = True

//----------------------------------------------------
version infor.
# Ubuntu 20.04.1 LTS
# Python 3.8.5
# django 3, 1, 5, 'final'
# django-cors-headers 3.7.0

# node v10.19.0
# react 17.0.1

# Flask 1.1.2


jagder

unread,
Feb 5, 2021, 9:15:27 AM2/5/21
to Django users
I have no idea my problem is fit in here "Django user community", however I tried to send question. 

I made dev environment under below.
# Container is Docker container.

background.jpg
//----------------------------------------------------




Reply all
Reply to author
Forward
0 new messages