Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL, Django Server started on windows, Can't access it on ubuntu WSL (using curl) #11409

Closed
1 of 2 tasks
arhantbararia opened this issue Apr 2, 2024 · 2 comments
Closed
1 of 2 tasks

Comments

@arhantbararia
Copy link

Windows Version

Microsoft Windows [Version 10.0.19045.4170]

WSL Version

1.2.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

Ubuntu 20.04

Other Software

Django==4.2.3
Python 3.8.0

Repro Steps

Start a boiler plate django server on windows machine using:

  • python manage.py runserver 0.0.0.0:8000

and then on WSL access it using:

  • curl -I http://127.0.0.1:8000

Expected Behavior

I would have expected this reponse

HTTP/1.1 200 OK
Date: Tue, 02 Apr 2024 09:03:15 GMT
Server: WSGIServer/0.2 CPython/3.10.12
Content-Type: text/html; charset=utf-8
X-Frame-Options: DENY
Vary: Cookie
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
Cross-Origin-Opener-Policy: same-origin

Actual Behavior

curl: (7) Failed to connect to 127.0.0.1 port 8000 after 1 ms: Connection refused

Diagnostic Logs

I think server ran fine:

Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
Django version 4.2.3, using settings 'project.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CTRL-BREAK.
Copy link

github-actions bot commented Apr 2, 2024

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@arhantbararia
Copy link
Author

Add a new inbound rules which allows 8000 port
image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant