A few days ago I started using Vagrant to develop our Django project at my old company. After I finished installing project’s dependencies and run python manage.py runserver, I couldn’t access 127.0.0.1:8000 from my browser even after I enabled vagrant’s port forwarding.
The thing is, Django’s default settings will listen on 127.0.0.1, which can only be accessed from within the Vagrant VM. So we need Django to listen on all network interfaces by binding it to 0.0.0.0. Running python manage.py runserver 0.0.0.0:8000 will fix this problem.