librelist archives

« back to archive

Beginner question regarding initializing Flask app

Beginner question regarding initializing Flask app

From:
Samrat Man Singh
Date:
2011-04-17 @ 08:13
I made some really basic apps using Flask, but I think I've still not fully
grasped how a Flask app is initialized.

app = Flask(__name__)


What does the __name__ do here in the above code?  Thanks.

Samrat

Re: [flask] Beginner question regarding initializing Flask app

From:
Ron DuPlain
Date:
2011-04-17 @ 08:18
Hi Samrat,

On Sun, Apr 17, 2011 at 4:13 AM, Samrat Man Singh
<samratmansingh@gmail.com> wrote:
> I made some really basic apps using Flask, but I think I've still not fully
> grasped how a Flask app is initialized.
>>
>> app = Flask(__name__)
>
> What does the __name__ do here in the above code?  Thanks.

See "About the First Parameter" here:
http://flask.pocoo.org/docs/api/#application-object

-Ron