Reputation: 23
I am trying to follow this online class, and I am stuck on the part where I access a local website made by django. The tutorial that I follow is this one by freecodecamp, and I get stuck by the 11min mark where I try to access the output site http://127.0.0.1:8000/ . I am following this tutorial on the browser version of Jupyter Notebook.
Tutorial: https://www.freecodecamp.org/news/create-an-e-commerce-site-with-django-and-vue/
The 'python manage.py runserver' line runs, and I get the following output:
System check identified no issues (0 silenced).
April 16, 2021 - 03:37:04
Django version 3.2, using settings 'djacket_django.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
When I copy and paste the server address into the browser, I just get the following error saying that I wasn't able to connect to the site:
Unable to connect
Firefox can’t establish a connection to the server at 127.0.0.1:8000.
The only resource I really found that addressed this issue was the following post, but when I went through my netstat list, there were no IPs listing :8000, so I don't think that I am using up that address already.
Post: Django manage.py runserver is not working
Upvotes: 0
Views: 643
Reputation: 8407
Sounds like you are using WSL2 and have not yet discovered that the WSL2 VM's IP address is not the same as the Windows IP address. Windows has its own idea of what localhost might be!
TL;DR: Use GWSL to run WSL2 apps on X Windows. This will allow you to run a browser from WSL2 over X Windows, and no worries.
Upvotes: 1