From b54ca636cd324cdd07a39d93855cc4651275d8e3 Mon Sep 17 00:00:00 2001 From: DAVID LEE Date: Thu, 5 Sep 2013 23:23:18 -0700 Subject: [PATCH] add the tip for SQLAlchemy db and model namespace --- Large-app-how-to.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Large-app-how-to.md b/Large-app-how-to.md index 626e266..9fdef03 100644 --- a/Large-app-how-to.md +++ b/Large-app-how-to.md @@ -424,6 +424,8 @@ Here is the `/app/__init__.py` : #app.register_blueprint(postsModule) ``` +Our SQLAlchemy db instance and models (User) are separated in two files, you need import both of them into namespace, which is done by `from app.users.views import mod as usersModule` implicitly. Otherwise the `db.create_all()` will do nothing. + Let's activate your virtualenv and initialize your database: user@Machine:~/Projects/dev$ . env/bin/activate