librelist archives

« back to archive

Hello.py help

Hello.py help

From:
Adam Sorel
Date:
2015-03-25 @ 23:17
Hello, I am new to this and I am trying to run the hello.py example on my
raspberry pi running the latest Rasbian OS version. I get an error that
says NameError: name '_name_' is not defined. The line it is in is app =
Flask(_name_). I have tried to ren it using python 2.7.3 and python 3.2.3.
Help would much be appreciated. Thank You

Re: [flask] Hello.py help

From:
Ian Bellamy
Date:
2015-03-25 @ 23:44
This may seem quit basic, but make sure that you try app = Flask(__name__)
 with two underscores on each side of 'name'.

On Wed, Mar 25, 2015 at 5:17 PM, Adam Sorel <soreladam@gmail.com> wrote:

> Hello, I am new to this and I am trying to run the hello.py example on my
> raspberry pi running the latest Rasbian OS version. I get an error that
> says NameError: name '_name_' is not defined. The line it is in is app =
> Flask(_name_). I have tried to ren it using python 2.7.3 and python 3.2.3.
> Help would much be appreciated. Thank You
>

Re: [flask] Hello.py help

From:
steve
Date:
2015-03-26 @ 21:22
FYI: For testing/application eval only. But there's a link to an excellent
tutorial site as well:
https://github.com/scshepard/FlaskPlan8

Date: Thu, 26 Mar 2015 16:27:10 -0400
From: soreladam@gmail.com
Subject: Re: [flask] Hello.py help
To: flask@librelist.com

Thank you Andy and Ian. It helped!
On Mar 26, 2015 3:30 PM, "Andy D'Arcy Jewell" <andy@wild-flower.co.uk> wrote:
On 25/03/15 23:17, Adam Sorel wrote:

>

> Hello, I am new to this and I am trying to run the hello.py example on

> my raspberry pi running the latest Rasbian OS version. I get an error

> that says NameError: name '_name_' is not defined. The line it is in

> is app = Flask(_name_). I have tried to ren it using python 2.7.3 and

> python 3.2.3. Help would much be appreciated. Thank You

>

Hi Adam,



Those should be "double-underscores":  _ _ n a m e _ _ (without the

spaces). It's a Python convention.



Hope that helps

 		 	   		  

Re: [flask] Hello.py help

From:
Andy D'Arcy Jewell
Date:
2015-03-26 @ 19:25
On 25/03/15 23:17, Adam Sorel wrote:
>
> Hello, I am new to this and I am trying to run the hello.py example on 
> my raspberry pi running the latest Rasbian OS version. I get an error 
> that says NameError: name '_name_' is not defined. The line it is in 
> is app = Flask(_name_). I have tried to ren it using python 2.7.3 and 
> python 3.2.3. Help would much be appreciated. Thank You
>
Hi Adam,

Those should be "double-underscores":  _ _ n a m e _ _ (without the 
spaces). It's a Python convention.

Hope that helps

Re: [flask] Hello.py help

From:
Adam Sorel
Date:
2015-03-26 @ 20:27
Thank you Andy and Ian. It helped!
On Mar 26, 2015 3:30 PM, "Andy D'Arcy Jewell" <andy@wild-flower.co.uk>
wrote:

> On 25/03/15 23:17, Adam Sorel wrote:
> >
> > Hello, I am new to this and I am trying to run the hello.py example on
> > my raspberry pi running the latest Rasbian OS version. I get an error
> > that says NameError: name '_name_' is not defined. The line it is in
> > is app = Flask(_name_). I have tried to ren it using python 2.7.3 and
> > python 3.2.3. Help would much be appreciated. Thank You
> >
> Hi Adam,
>
> Those should be "double-underscores":  _ _ n a m e _ _ (without the
> spaces). It's a Python convention.
>
> Hope that helps
>