[Flask] Flask on Ubuntu on Windows

Gabor Szabo gabor at szabgab.com
Tue Sep 12 18:29:39 EDT 2017


On Tue, Sep 12, 2017 at 11:31 PM, Geert Stappers <stappers at stappers.nl> wrote:
> On Tue, Sep 12, 2017 at 07:50:36PM +0000, Mazzei, Stephen Andrew wrote:
>> Good afternoon,
>>
>> Been a while since I reached out, but with the off-season soon upon us
>> at work, I have been tasked with new HTML projects. I started dusting
>> off the ol' notes and surprise the environment is not working.
>>
>> From what I can remember and tell by my notes, all I did was load up
>> my bash environment in windows, change to the flask environment and
>> launch the startup script. All the utilities are still installed,
>> and the prompt for 127.0.0.1:5000 pops up. But when I open firefox
>> and try going to the website, I get an unable to connect.
>>
>> Is anyone else doing anything with flask and Windows/ubuntu/bash?
>>
>
> I think that it is Windows as host system and Ubuntu as guest container.
> Firefox is on the host and connects to host port 5000.
>
> The missing part is probably something that make guest port 5000
> visable on the host.
>
> Meanwhile check inside the container flask. Do something like
>   wget http://localhost:5000
> or
>   nc localhost 5000
>

Either that or Flask by default only listens to connections arriving
from the same machine.
You probably need to tell it to listen on 0.0.0.0

Run it with

flask run --host 0.0.0.0

Gabor


More information about the Flask mailing list