¿Accediendo a localhost externamente?
Esta es probablemente una pregunta muy básica. Yo SSH a mi servidor virtual de Ubuntu e inicio un servidor web django que se ejecuta en localhost:
Downloading/unpacking django
Downloading Django-1.9.5-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Installing collected packages: django
Successfully installed django
Cleaning up...
Performing system checks...
System check identified no issues (0 silenced).
You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
April 13, 2016 - 14:16:19
Django version 1.9.5, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
El servidor Ubuntu tiene una IP estática [x.xxx.xxx.xxx], así que desde otra máquina en otra red trato de acceder al sitio web anterior en un navegador usando esa dirección IP estática:
x.xxx.xxx.xxx:8000
Pero me sale:
This site can’t be reached
x.xxx.xxx.xxx refused to connect.
ERR_CONNECTION_REFUSED
Entonces, ¿asumo que no puedo acceder al sitio web de esta manera y que solo está disponible en el host mismo aunque el host tenga una dirección IP externa / estática?
Editar:
La respuesta también está en:https://docs.djangoproject.com/en/1.9/intro/tutorial01/#the-development-server
python manage.py runserver 0.0.0.0:8000