librelist archives

« back to archive

newbie help

newbie help

From:
Larry Martell
Date:
2014-11-04 @ 13:16
I am trying to get started with flask. I am running with virtualbox
and vagrant, running Ubuntu with nginx, hosted on a Mac.

When I try the hello app and I go to 127.0.0.1:5000 I get connection
refused. I can't find any logs or anything that will help me debug
this. Where would I look for logs so I can debug this?

Re: [flask] newbie help

From:
Bernard Ojengwa
Date:
2014-11-04 @ 13:28
Hi, Larry

Did you set *debug=True* when you called the 'run' method on your app?
Maybe you could share snippets of code from so we can help with debugging.
Welcome to awesomeness!

On Tue, Nov 4, 2014 at 2:16 PM, Larry Martell <larry.martell@gmail.com>
wrote:

> I am trying to get started with flask. I am running with virtualbox
> and vagrant, running Ubuntu with nginx, hosted on a Mac.
>
> When I try the hello app and I go to 127.0.0.1:5000 I get connection
> refused. I can't find any logs or anything that will help me debug
> this. Where would I look for logs so I can debug this?
>



-- 
*Ojengwa, Bernard,*
*Polyglot Software Engineer.*

*Mobile : +234(0)8037227918*
*Email : bernardojengwa@gmail.com <bernardojengwa@gmail.com>*
*Twitter : @ojengwa_ <https://twitter.com/ojengwa_> *
*Facebook : Bernard Ojengwa <https://www.facebook.com/ojengwa>*
*Google + : Bernard Ojengwa <https://www.google.com/+BernardOjengwa>*
*LinkedIn : LinkedIn Profile <http://ng.linkedin.com/in/ojengwa/>*
*Github : Github Profile <https://www.github.com/ojengwa>*
*Bitbucket : Bitbucket Profile <http://bitbucket.org/ojengwa>*
About.me : About.me Profile <http://about.me/ojengwa>

*Note*: Privileged/Confidential information may be contained in this
message and may be subject to legal privilege. Access to this e-mail by
anyone other than the intended is unauthorized. If you are not the intended
recipient (or responsible for delivery of the message to such person), you
may not use, copy, distribute or deliver to anyone this message (or any
part of its contents ) or take any action in reliance on it. In such case,
you should destroy this message, and notify me immediately. If you have
received this email in error, also please notify me immediately by e-mail
or telephone and delete the e-mail from any computer.

Re: [flask] newbie help

From:
Paul Korzhyk
Date:
2014-11-04 @ 13:35
If flask is running inside a virtualbox you probably should connect to
http://<ip addr of virtual machine>:5000, shouldn't you?

On Wed, Nov 5, 2014 at 12:28 AM, Bernard Ojengwa <bernardojengwa@gmail.com>
wrote:

> Hi, Larry
>
> Did you set *debug=True* when you called the 'run' method on your app?
> Maybe you could share snippets of code from so we can help with debugging.
> Welcome to awesomeness!
>
> On Tue, Nov 4, 2014 at 2:16 PM, Larry Martell <larry.martell@gmail.com>
> wrote:
>
>> I am trying to get started with flask. I am running with virtualbox
>> and vagrant, running Ubuntu with nginx, hosted on a Mac.
>>
>> When I try the hello app and I go to 127.0.0.1:5000 I get connection
>> refused. I can't find any logs or anything that will help me debug
>> this. Where would I look for logs so I can debug this?
>>
>
>
>
> --
> *Ojengwa, Bernard,*
> *Polyglot Software Engineer.*
>
> *Mobile : +234(0)8037227918 <%2B234%280%298037227918>*
> *Email : bernardojengwa@gmail.com <bernardojengwa@gmail.com>*
> *Twitter : @ojengwa_ <https://twitter.com/ojengwa_> *
> *Facebook : Be rnard Ojengwa <https://www.facebook.com/ojengwa>*
> *Google + : Bernard Ojengwa <https://www.google.com/+BernardOjengwa>*
> *LinkedIn : LinkedIn Profile <http://ng.linkedin.com/in/ojengwa/>*
> *Github : Github Profile <https://www.github.com/ojengwa>*
> *Bitbucket : Bitbucket Profile <http://bitbucket.org/ojengwa>*
> About.me : About.me Profile <http://about.me/ojengwa>
>
> *Note*: Privileged/Confidential information may be contained in this
> message and may be subject to legal privilege. Access to this e-mail by
> anyone other than the intended is unauthorized. If you are not the intended
> recipient (or responsible for delivery of the message to such person), you
> may not use, copy, distribute or deliver to anyone this message (or any
> part of its contents ) or take any action in reliance on it. In such case,
> you should destroy this message, and notify me immediately. If you have
> received this email in error, also please notify me immediately by e-mail
> or telephone and delete the e-mail from any computer.
>

Re: [flask] newbie help

From:
Larry Martell
Date:
2014-11-04 @ 13:44
I tried that, no joy. Do I have to tell flask to run the server at a
different address?

On Tue, Nov 4, 2014 at 8:35 AM, Paul Korzhyk <paul.korzhyk@gmail.com> wrote:
> If flask is running inside a virtualbox you probably should connect to
> http://<ip addr of virtual machine>:5000, shouldn't you?
>
> On Wed, Nov 5, 2014 at 12:28 AM, Bernard Ojengwa <bernardojengwa@gmail.com>
> wrote:
>>
>> Hi, Larry
>>
>> Did you set debug=True when you called the 'run' method on your app?
>> Maybe you could share snippets of code from so we can help with debugging.
>> Welcome to awesomeness!
>>
>> On Tue, Nov 4, 2014 at 2:16 PM, Larry Martell <larry.martell@gmail.com>
>> wrote:
>>>
>>> I am trying to get started with flask. I am running with virtualbox
>>> and vagrant, running Ubuntu with nginx, hosted on a Mac.
>>>
>>> When I try the hello app and I go to 127.0.0.1:5000 I get connection
>>> refused. I can't find any logs or anything that will help me debug
>>> this. Where would I look for logs so I can debug this?

Re: [flask] newbie help

From:
Eric B
Date:
2014-11-04 @ 13:52
Are you opening the browser within the VirtualBox guest -- i.e. Ubuntu --
or the Host -- i.e. Mac?  For development purposes that's how one would
develop locally.

Also, as an FYI, Flask and python packages in general install/run great on
mac.

On Tue Nov 04 2014 at 8:48:42 AM Larry Martell <larry.martell@gmail.com>
wrote:

> I tried that, no joy. Do I have to tell flask to run the server at a
> different address?
>
> On Tue, Nov 4, 2014 at 8:35 AM, Paul Korzhyk <paul.korzhyk@gmail.com>
> wrote:
> > If flask is running inside a virtualbox you probably should connect to
> > http://<ip addr of virtual machine>:5000, shouldn't you?
> >
> > On Wed, Nov 5, 2014 at 12:28 AM, Bernard Ojengwa <
> bernardojengwa@gmail.com>
> > wrote:
> >>
> >> Hi, Larry
> >>
> >> Did you set debug=True when you called the 'run' method on your app?
> >> Maybe you could share snippets of code from so we can help with
> debugging.
> >> Welcome to awesomeness!
> >>
> >> On Tue, Nov 4, 2014 at 2:16 PM, Larry Martell <larry.martell@gmail.com>
> >> wrote:
> >>>
> >>> I am trying to get started with flask. I am running with virtualbox
> >>> and vagrant, running Ubuntu with nginx, hosted on a Mac.
> >>>
> >>> When I try the hello app and I go to 127.0.0.1:5000 I get connection
> >>> refused. I can't find any logs or anything that will help me debug
> >>> this. Where would I look for logs so I can debug this?
>

Re: [flask] newbie help

From:
Larry Martell
Date:
2014-11-04 @ 14:10
On the Mac. I'll have to try doing it from the guest OS.

I know it all works from the Mac, but this project has to be done on Ubuntu.

On Tue, Nov 4, 2014 at 8:52 AM, Eric B <neurosnap@gmail.com> wrote:
> Are you opening the browser within the VirtualBox guest -- i.e. Ubuntu -- or
> the Host -- i.e. Mac?  For development purposes that's how one would develop
> locally.
>
> Also, as an FYI, Flask and python packages in general install/run great on
> mac.
>
> On Tue Nov 04 2014 at 8:48:42 AM Larry Martell <larry.martell@gmail.com>
> wrote:
>>
>> I tried that, no joy. Do I have to tell flask to run the server at a
>> different address?
>>
>> On Tue, Nov 4, 2014 at 8:35 AM, Paul Korzhyk <paul.korzhyk@gmail.com>
>> wrote:
>> > If flask is running inside a virtualbox you probably should connect to
>> > http://<ip addr of virtual machine>:5000, shouldn't you?
>> >
>> > On Wed, Nov 5, 2014 at 12:28 AM, Bernard Ojengwa
>> > <bernardojengwa@gmail.com>
>> > wrote:
>> >>
>> >> Hi, Larry
>> >>
>> >> Did you set debug=True when you called the 'run' method on your app?
>> >> Maybe you could share snippets of code from so we can help with
>> >> debugging.
>> >> Welcome to awesomeness!
>> >>
>> >> On Tue, Nov 4, 2014 at 2:16 PM, Larry Martell <larry.martell@gmail.com>
>> >> wrote:
>> >>>
>> >>> I am trying to get started with flask. I am running with virtualbox
>> >>> and vagrant, running Ubuntu with nginx, hosted on a Mac.
>> >>>
>> >>> When I try the hello app and I go to 127.0.0.1:5000 I get connection
>> >>> refused. I can't find any logs or anything that will help me debug
>> >>> this. Where would I look for logs so I can debug this?

Re: [flask] newbie help

From:
Eric B
Date:
2014-11-04 @ 14:16
Gotcha, I do a lot of development with VirtualBox Mac + Ubuntu as well,
personally I wouldn't bother trying to get your development site on your
guest to work on your host.

On Tue Nov 04 2014 at 9:14:44 AM Larry Martell <larry.martell@gmail.com>
wrote:

> On the Mac. I'll have to try doing it from the guest OS.
>
> I know it all works from the Mac, but this project has to be done on
> Ubuntu.
>
> On Tue, Nov 4, 2014 at 8:52 AM, Eric B <neurosnap@gmail.com> wrote:
> > Are you opening the browser within the VirtualBox guest -- i.e. Ubuntu
> -- or
> > the Host -- i.e. Mac?  For development purposes that's how one would
> develop
> > locally.
> >
> > Also, as an FYI, Flask and python packages in general install/run great
> on
> > mac.
> >
> > On Tue Nov 04 2014 at 8:48:42 AM Larry Martell <larry.martell@gmail.com>
> > wrote:
> >>
> >> I tried that, no joy. Do I have to tell flask to run the server at a
> >> different address?
> >>
> >> On Tue, Nov 4, 2014 at 8:35 AM, Paul Korzhyk <paul.korzhyk@gmail.com>
> >> wrote:
> >> > If flask is running inside a virtualbox you probably should connect to
> >> > http://<ip addr of virtual machine>:5000, shouldn't you?
> >> >
> >> > On Wed, Nov 5, 2014 at 12:28 AM, Bernard Ojengwa
> >> > <bernardojengwa@gmail.com>
> >> > wrote:
> >> >>
> >> >> Hi, Larry
> >> >>
> >> >> Did you set debug=True when you called the 'run' method on your app?
> >> >> Maybe you could share snippets of code from so we can help with
> >> >> debugging.
> >> >> Welcome to awesomeness!
> >> >>
> >> >> On Tue, Nov 4, 2014 at 2:16 PM, Larry Martell <
> larry.martell@gmail.com>
> >> >> wrote:
> >> >>>
> >> >>> I am trying to get started with flask. I am running with virtualbox
> >> >>> and vagrant, running Ubuntu with nginx, hosted on a Mac.
> >> >>>
> >> >>> When I try the hello app and I go to 127.0.0.1:5000 I get
> connection
> >> >>> refused. I can't find any logs or anything that will help me debug
> >> >>> this. Where would I look for logs so I can debug this?
>

Re: [flask] newbie help

From:
Aaron Crowder
Date:
2014-11-04 @ 15:19
Larry,

It sounds to me like port 5000 isn't open on the Ubuntu VM. Make sure that
it is and point the browser in the host machine to <ip of ubuntu vm>:5000

On Tue Nov 04 2014 at 7:21:11 AM Eric B <neurosnap@gmail.com> wrote:

> Gotcha, I do a lot of development with VirtualBox Mac + Ubuntu as well,
> personally I wouldn't bother trying to get your development site on your
> guest to work on your host.
>
> On Tue Nov 04 2014 at 9:14:44 AM Larry Martell <larry.martell@gmail.com>
> wrote:
>
>> On the Mac. I'll have to try doing it from the guest OS.
>>
>> I know it all works from the Mac, but this project has to be done on
>> Ubuntu.
>>
>> On Tue, Nov 4, 2014 at 8:52 AM, Eric B <neurosnap@gmail.com> wrote:
>> > Are you opening the browser within the VirtualBox guest -- i.e. Ubuntu
>> -- or
>> > the Host -- i.e. Mac?  For development purposes that's how one would
>> develop
>> > locally.
>> >
>> > Also, as an FYI, Flask and python packages in general install/run great
>> on
>> > mac.
>> >
>> > On Tue Nov 04 2014 at 8:48:42 AM Larry Martell <larry.martell@gmail.com
>> >
>> > wrote:
>> >>
>> >> I tried that, no joy. Do I have to tell flask to run the server at a
>> >> different address?
>> >>
>> >> On Tue, Nov 4, 2014 at 8:35 AM, Paul Korzhyk <paul.korzhyk@gmail.com>
>> >> wrote:
>> >> > If flask is running inside a virtualbox you probably should connect
>> to
>> >> > http://<ip addr of virtual machine>:5000, shouldn't you?
>> >> >
>> >> > On Wed, Nov 5, 2014 at 12:28 AM, Bernard Ojengwa
>> >> > <bernardojengwa@gmail.com>
>> >> > wrote:
>> >> >>
>> >> >> Hi, Larry
>> >> >>
>> >> >> Did you set debug=True when you called the 'run' method on your app?
>> >> >> Maybe you could share snippets of code from so we can help with
>> >> >> debugging.
>> >> >> Welcome to awesomeness!
>> >> >>
>> >> >> On Tue, Nov 4, 2014 at 2:16 PM, Larry Martell <
>> larry.martell@gmail.com>
>> >> >> wrote:
>> >> >>>
>> >> >>> I am trying to get started with flask. I am running with virtualbox
>> >> >>> and vagrant, running Ubuntu with nginx, hosted on a Mac.
>> >> >>>
>> >> >>> When I try the hello app and I go to 127.0.0.1:5000 I get
>> connection
>> >> >>> refused. I can't find any logs or anything that will help me debug
>> >> >>> this. Where would I look for logs so I can debug this?
>>
>

Re: [flask] newbie help

From:
Matthias Urlichs
Date:
2014-11-04 @ 15:26
Hi,

Aaron Crowder:
> It sounds to me like port 5000 isn't open on the Ubuntu VM. Make sure that
> it is and point the browser in the host machine to <ip of ubuntu vm>:5000
> 
Or, if the VM shares the host's IP space, you may have to tell the
VM manager to open port 5000 and forward it to the guest.
-- 
-- Matthias Urlichs

unsubscribe

From:
Philipp Teister
Date:
2014-11-04 @ 14:22
unsubscribe

Re: [flask] newbie help

From:
Eric B
Date:
2014-11-04 @ 13:54
Sorry, I meant to say you should open the browser within the guest --
Ubuntu -- for development purposes.

On Tue Nov 04 2014 at 8:52:52 AM Eric B <neurosnap@gmail.com> wrote:

> Are you opening the browser within the VirtualBox guest -- i.e. Ubuntu --
> or the Host -- i.e. Mac?  For development purposes that's how one would
> develop locally.
>
> Also, as an FYI, Flask and python packages in general install/run great on
> mac.
>
> On Tue Nov 04 2014 at 8:48:42 AM Larry Martell <larry.martell@gmail.com>
> wrote:
>
>> I tried that, no joy. Do I have to tell flask to run the server at a
>> different address?
>>
>> On Tue, Nov 4, 2014 at 8:35 AM, Paul Korzhyk <paul.korzhyk@gmail.com>
>> wrote:
>> > If flask is running inside a virtualbox you probably should connect to
>> > http://<ip addr of virtual machine>:5000, shouldn't you?
>> >
>> > On Wed, Nov 5, 2014 at 12:28 AM, Bernard Ojengwa <
>> bernardojengwa@gmail.com>
>> > wrote:
>> >>
>> >> Hi, Larry
>> >>
>> >> Did you set debug=True when you called the 'run' method on your app?
>> >> Maybe you could share snippets of code from so we can help with
>> debugging.
>> >> Welcome to awesomeness!
>> >>
>> >> On Tue, Nov 4, 2014 at 2:16 PM, Larry Martell <larry.martell@gmail.com
>> >
>> >> wrote:
>> >>>
>> >>> I am trying to get started with flask. I am running with virtualbox
>> >>> and vagrant, running Ubuntu with nginx, hosted on a Mac.
>> >>>
>> >>> When I try the hello app and I go to 127.0.0.1:5000 I get connection
>> >>> refused. I can't find any logs or anything that will help me debug
>> >>> this. Where would I look for logs so I can debug this?
>>
>

Re: [flask] newbie help

From:
Larry Martell
Date:
2014-11-04 @ 13:39
I am just trying the hello app:

from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run(debug=True)

I do not get any output.


On Tue, Nov 4, 2014 at 8:28 AM, Bernard Ojengwa
<bernardojengwa@gmail.com> wrote:
> Hi, Larry
>
> Did you set debug=True when you called the 'run' method on your app?
> Maybe you could share snippets of code from so we can help with debugging.
> Welcome to awesomeness!
>
> On Tue, Nov 4, 2014 at 2:16 PM, Larry Martell <larry.martell@gmail.com>
> wrote:
>>
>> I am trying to get started with flask. I am running with virtualbox
>> and vagrant, running Ubuntu with nginx, hosted on a Mac.
>>
>> When I try the hello app and I go to 127.0.0.1:5000 I get connection
>> refused. I can't find any logs or anything that will help me debug
>> this. Where would I look for logs so I can debug this?

Re: [flask] newbie help

From:
Daniel Neuhäuser
Date:
2014-11-04 @ 15:29
The server runs on the guest but you are accessing the port on the host 
os. Configure vagrant to forward the port, the default Vagrantfile 
contains an example for that. 

Re: [flask] newbie help

From:
Aaron Crowder
Date:
2014-11-04 @ 15:39
Matthias and Daniel got it right. I've never used Vagrant so I wasn't aware
that was possible.

On Tue Nov 04 2014 at 8:36:29 AM Daniel Neuhäuser <ich@danielneuhaeuser.de>
wrote:

> The server runs on the guest but you are accessing the port on the host
> os. Configure vagrant to forward the port, the default Vagrantfile contains
> an example for that.
>

Re: [flask] newbie help

From:
Chris McLaurin
Date:
2014-11-04 @ 15:48
You need to do to things.
Change your app run command to this
app.run(host='0.0.0.0')

This tells your app to listen on all ports

Change your Vagrantfile line
config.vm.network "private_network", ip: "33.33.33.33"

This makes your Vagrant machine accessible to your host computer at
http://33.33.33.33

then restart Vagrant (vagrant reload)

Start your app

Now you should be able to get to your app using http://33.33.33.33:5000

Get this working first, then worry about nginix (and look ag gunicorn for
WSGI)

.cm





On Tue Nov 04 2014 at 9:36:24 AM Daniel Neuhäuser <ich@danielneuhaeuser.de>
wrote:

> The server runs on the guest but you are accessing the port on the host
> os. Configure vagrant to forward the port, the default Vagrantfile contains
> an example for that.
>

Re: [flask] newbie help

From:
Matthias Urlichs
Date:
2014-11-04 @ 15:59
Hi,

> config.vm.network "private_network", ip: "33.33.33.33"
> 
Please do not get into the habit of allocating random IP addresses for
local use.

RFC 1918 is your friend: 10.10.10.10 is a better choice.

-- 
-- Matthias Urlichs

Re: [flask] newbie help

From:
Chris McLaurin
Date:
2014-11-04 @ 19:06
Friend yes, but not as much fun for the Chaos Monkeys.

On Tue, Nov 4, 2014 at 9:59 AM, Matthias Urlichs <matthias@urlichs.de>
wrote:

> Hi,
>
> > config.vm.network "private_network", ip: "33.33.33.33"
> >
> Please do not get into the habit of allocating random IP addresses for
> local use.
>
> RFC 1918 is your friend: 10.10.10.10 is a better choice.
>
> --
> -- Matthias Urlichs
>



-- 
.cm

Re: [flask] newbie help

From:
Matt Smith
Date:
2014-11-07 @ 12:35
>
> Change your app run command to this
> app.run(host='0.0.0.0')
>


> This tells your app to listen on all ports


Just want to clear this up, this allows the application to listen on all
network interfaces, not all ports.
Most configurations will have different network interfaces (your single
network card, 127.0.0.1 / localhost) however with certain configurations
you can get more.

The host parameter is meant so you can define which of the interfaces you
which to use. (one maybe public facing and the other may be private only)

When you define host to "0.0.0.0" you choose to listen on all interfaces
and just bind to whatever is available.


*Regards,*
*Matt Smith*Summoner: *PsyKzz* | *@**PsyKzz*


On 4 November 2014 19:06, Chris McLaurin <chrismclaurin@gmail.com> wrote:

> Friend yes, but not as much fun for the Chaos Monkeys.
>
> On Tue, Nov 4, 2014 at 9:59 AM, Matthias Urlichs <matthias@urlichs.de>
> wrote:
>
>> Hi,
>>
>> > config.vm.network "private_network", ip: "33.33.33.33"
>> >
>> Please do not get into the habit of allocating random IP addresses for
>> local use.
>>
>> RFC 1918 is your friend: 10.10.10.10 is a better choice.
>>
>> --
>> -- Matthias Urlichs
>>
>
>
>
> --
> .cm
>