Proper model directory structure #97

yuvadm opened this Issue Aug 17, 2012 · 1 comment

2 participants


I found no mention in the docs about the proper way to structure models in a Flask app. Right now I have this:

db = SQLAlchemy(app)


from app import db
class MyModel(db.Model):
# ...

But this means I have a circular dependency once I try to do:

from models import MyModel

It's worth mentioning how this should be done in the docs.


This isn't a Flask-SQLAlchemy issue per se, it largely depends of the structure of your app.

There's plenty of guides which outline various different ways of structuring a Flask app which includes Flask-SQLAlchemy.

@immunda immunda closed this Apr 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment