librelist archives

« back to archive

Large-app how to example missing documentation

Large-app how to example missing documentation

From:
Mr. White
Date:
2012-10-02 @ 20:41
Hi,

I'm fairly new to flask, and I have been trying to follow the example of
the Large-app-how-to (
https://github.com/mitsuhiko/flask/wiki/Large-app-how-to).

But I struggle with the missing database module. In the file
/app/users/models.py there is an import statement (from app import db), and
in the end of the tutorial we're calling db.create_all(), but it does not
exist. Can anyone give some guidance to a solution.

Mr. White

Re: [flask] Large-app how to example missing documentation

From:
Kirill Klenov
Date:
2012-10-02 @ 20:49
Maybe you also look at https://github.com/klen/Flask-Foundation


Kirill Klenov
web developer
______________________________________________________________________
horneds@gmail.com | http://klen.github.com
mobile: +7 906 772-36-20


2012/10/3 Mr. White <happygoat666@gmail.com>:
> Hi,
>
> I'm fairly new to flask, and I have been trying to follow the example of the
> Large-app-how-to (https://github.com/mitsuhiko/flask/wiki/Large-app-how-to).
>
> But I struggle with the missing database module. In the file
> /app/users/models.py there is an import statement (from app import db), and
> in the end of the tutorial we're calling db.create_all(), but it does not
> exist. Can anyone give some guidance to a solution.
>
> Mr. White

Re: [flask] Large-app how to example missing documentation

From:
kracekumar ramaraju
Date:
2012-10-03 @ 05:07
Here is the app which we are working on https://github.com/hasgeek/hacknight,
it is in production http://hacknight.in, it organised pretty well.

On Wed, Oct 3, 2012 at 2:19 AM, Kirill Klenov <horneds@gmail.com> wrote:

> Maybe you also look at https://github.com/klen/Flask-Foundation
>
>
> Kirill Klenov
> web developer
> ______________________________________________________________________
> horneds@gmail.com | http://klen.github.com
> mobile: +7 906 772-36-20
>
>
> 2012/10/3 Mr. White <happygoat666@gmail.com>:
> > Hi,
> >
> > I'm fairly new to flask, and I have been trying to follow the example of
> the
> > Large-app-how-to (
> https://github.com/mitsuhiko/flask/wiki/Large-app-how-to).
> >
> > But I struggle with the missing database module. In the file
> > /app/users/models.py there is an import statement (from app import db),
> and
> > in the end of the tutorial we're calling db.create_all(), but it does not
> > exist. Can anyone give some guidance to a solution.
> >
> > Mr. White
>



-- 
*
Thanks & Regards

"Talk is cheap, show me the code" -- Linus Torvalds
kracekumar
www.kracekumar.com
*

Re: [flask] Large-app how to example missing documentation

From:
Mr. White
Date:
2012-10-03 @ 07:18
Flask-Foundation looks promising, although a bit overwhelming for me at
this stage. But easy to see that a lot of thought have gone into this...

On Tue, Oct 2, 2012 at 10:49 PM, Kirill Klenov <horneds@gmail.com> wrote:

> Maybe you also look at https://github.com/klen/Flask-Foundation
>
>
> Kirill Klenov
> web developer
> ______________________________________________________________________
> horneds@gmail.com | http://klen.github.com
> mobile: +7 906 772-36-20
>
>
> 2012/10/3 Mr. White <happygoat666@gmail.com>:
> > Hi,
> >
> > I'm fairly new to flask, and I have been trying to follow the example of
> the
> > Large-app-how-to (
> https://github.com/mitsuhiko/flask/wiki/Large-app-how-to).
> >
> > But I struggle with the missing database module. In the file
> > /app/users/models.py there is an import statement (from app import db),
> and
> > in the end of the tutorial we're calling db.create_all(), but it does not
> > exist. Can anyone give some guidance to a solution.
> >
> > Mr. White
>

Re: [flask] Large-app how to example missing documentation

From:
Lukas Blakk
Date:
2012-10-02 @ 20:47
Looks like you need the following:

from flask.ext.sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.secret_key = SECRET
app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI
db = SQLAlchemy(app)


which I got from 
http://packages.python.org/Flask-SQLAlchemy/quickstart.html#quickstart


Cheers,
Lukas

On Oct 2, 2012, at 1:41 PM, "Mr. White" <happygoat666@gmail.com> wrote:

> Hi,
> 
> I'm fairly new to flask, and I have been trying to follow the example of
the Large-app-how-to 
(https://github.com/mitsuhiko/flask/wiki/Large-app-how-to).
> 
> But I struggle with the missing database module. In the file 
/app/users/models.py there is an import statement (from app import db), 
and in the end of the tutorial we're calling db.create_all(), but it does 
not exist. Can anyone give some guidance to a solution.
> 
> Mr. White

Re: [flask] Large-app how to example missing documentation

From:
Mr. White
Date:
2012-10-03 @ 07:19
I have already this in the config.py file, but thanks for your help
anyway...

On Tue, Oct 2, 2012 at 10:47 PM, Lukas Blakk <lukasblakk@gmail.com> wrote:

> Looks like you need the following:
>
> from flask.ext.sqlalchemy import SQLAlchemy
>
> app = Flask(__name__)
> app.secret_key = SECRET
> app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI
> db = SQLAlchemy(app)
>
>
> which I got from
> http://packages.python.org/Flask-SQLAlchemy/quickstart.html#quickstart
>
>
> Cheers,
> Lukas
>
> On Oct 2, 2012, at 1:41 PM, "Mr. White" <happygoat666@gmail.com> wrote:
>
> Hi,
>
> **I'm fairly new to flask, and I have been trying to follow the example
> of the Large-app-how-to (
> https://github.com/mitsuhiko/flask/wiki/Large-app-how-to).
>
>
> But I struggle with the missing database module. In the file
> /app/users/models.py there is an import statement (from app im port db),
> and in the end of the tutorial we're calling db.create_all(), but it does
> not exist. Can anyone give some guidance to a solution.
>
> Mr. White
>
>

Re: [flask] Large-app how to example missing documentation

From:
Mr. White
Date:
2012-10-03 @ 07:39
Ohhh, I have found the error. The __init__.py file was located in the wrong
subdir. Sorry guys!

On Wed, Oct 3, 2012 at 9:19 AM, Mr. White <happygoat666@gmail.com> wrote:

> I have already this in the config.py file, but thanks for your help
> anyway...
>
>
> On Tue, Oct 2, 2012 at 10:47 PM, Lukas Blakk <lukasblakk@gmail.com> wrote:
>
>> Looks like you need the following:
>>
>> from flask.ext.sqlalchemy import SQLAlchemy
>>
>> app = Flask(__name__)
>> app.secret_key = SECRET
>> app.config['SQLALCHEMY_DATABASE_URI'] = DATABASE_URI
>> db = SQLAlchemy(app)
>>
>>
>> which I got from
>> http://packages.python.org/Flask-SQLAlchemy/quickstart.html#quickstart
>>
>>
>> Cheers,
>> Lukas
>>
>> On Oct 2, 2012, at 1:41 PM, "Mr. White" <happygoat666@gmail.com> wrote:
>>
>> Hi,
>>
>> **I'm fairly new to flask, and I have been trying to follow the example
>> of the Large-app-how-to (
>> https://github.com/mitsuhiko/flask/wiki/Large-app-how-to).
>>
>>
>> But I struggle with the missing database module. In the file
>> /app/users/models.py there is an import statement (from app im port db),
>> and in the end of the tutorial we're calling db.create_all(), but it
>> does not exist. Can anyone give some guidance to a solution.
>>
>> Mr. White
>>
>>
>