Programing/Python

[Django] 서버주소 0.0.0.0

mjune.kim 2019. 4. 8. 10:29

https://en.wikipedia.org/wiki/0.0.0.0

 

0.0.0.0 - Wikipedia

In the Internet Protocol Version 4, the address 0.0.0.0 is a non-routable meta-address used to designate an invalid, unknown or non-applicable target. This address is assigned specific meanings in a number of contexts, such as on clients or on servers.[1]

en.wikipedia.org

별도의 설정 없이 서버 외부에서 접근하려면 장고 서버 실행 시 127.0.0.1 대신 0.0.0.0 주소 또는 서버의 실제 IP주소로 실행시켜 주면 됩니다.

디폴트 포트는 8000 로 실행되기 때문에 포트정보를 추가로 설정해줘야 합니다.

$> python manage.py runserver '0.0.0.0:8080' or '10.32.x.x:8000'

0.0.0.0 주소는 호스트 서버가 가지고 있는 주소 모두 접근이 가능하도록 설정합니다.