Reach the server

6 views
Skip to first unread message

CHENXIN YANG

unread,
Jul 15, 2019, 10:22:35 PM7/15/19
to Django users
I created the new Django project on a vagrant virtual box, but I had trouble reaching the server at http://127.0.0.1:8000/ after running the server.

Jani Tiainen

unread,
Jul 16, 2019, 9:52:07 AM7/16/19
to django...@googlegroups.com
Hi.

Did you mapped 8000 port to outside of vagrant box? And did you told runserver to listen all interfaces (0.0.0.0) since by default runserver listens to localhost. In case of vagrant "localhost" interface is within vagrant box itself.

ti 16. heinäk. 2019 klo 5.22 CHENXIN YANG <chenx...@g.ucla.edu> kirjoitti:
I created the new Django project on a vagrant virtual box, but I had trouble reaching the server at http://127.0.0.1:8000/ after running the server.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8a75bfed-68f1-45f5-a029-1367674fab2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mohammed habib

unread,
Jul 16, 2019, 3:48:46 PM7/16/19
to django...@googlegroups.com
You also need to make sure that your port 8000 from the guest virtualbox maps to port 8000 on your host virtualbox

Sent from my iPhone

On 15 Jul 2019, at 23:34, CHENXIN YANG <chenx...@g.ucla.edu> wrote:

I created the new Django project on a vagrant virtual box, but I had trouble reaching the server at http://127.0.0.1:8000/ after running the server.

--

mohammed habib

unread,
Jul 16, 2019, 3:48:46 PM7/16/19
to django...@googlegroups.com
To expose your server to external hosts try running:

Python manage.py runserver 0.0.0.0:8000


Sent from my iPhone

On 15 Jul 2019, at 23:34, CHENXIN YANG <chenx...@g.ucla.edu> wrote:

I created the new Django project on a vagrant virtual box, but I had trouble reaching the server at http://127.0.0.1:8000/ after running the server.

--

CHENXIN YANG

unread,
Jul 16, 2019, 6:42:50 PM7/16/19
to django...@googlegroups.com
Thanks for the help!
After running the command Python manage.py runserver 0.0.0.0:8000, I still couldn't reach the server. And could you tell me more details about how to make sure that my port 8000 from the guest virtualbox maps to port 8000 on the host virtualbox?




mohammed habib

unread,
Jul 16, 2019, 10:31:26 PM7/16/19
to django...@googlegroups.com
Perhaps try this article: https://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/


If you are using something like Vagrant it’s easier, you just need to update your vagrantfile with one setting and then run ‘vagrant reload’ 

Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages