Explained Flask constructor better. This fixes #70

This commit is contained in:
Armin Ronacher 2010-07-01 12:56:34 +02:00
parent bc662a546e
commit 3ab318a7dd
2 changed files with 34 additions and 1 deletions

View file

@ -38,7 +38,12 @@ see your hello world greeting.
So what did that code do?
1. first we imported the :class:`~flask.Flask` class. An instance of this
class will be our WSGI application.
class will be our WSGI application. The first argument is the name of
the application's module. If you are using a single module (like here)
you should use `__name__` because depending on if it's started as
application or imported as module the name will be different
(``'__main__'`` versus the actual import name). For more information
on that, have a look at the :class:`~flask.Flask` documentation.
2. next we create an instance of it. We pass it the name of the module /
package. This is needed so that Flask knows where it should look for
templates, static files and so on.