add the tip for SQLAlchemy db and model namespace

DAVID LEE 2013-09-05 23:23:18 -07:00
parent 5d7ab336b5
commit b54ca636cd

@ -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