I have a base flask app that I have put together to build future projects from. I have it set up with an application factory method "create_app".
https://github.com/thenetimp/flask_base_v2/blob/master/app/init.py#L1-L32
In the create_app method, I am initializing the application object. Then pass it to the previously initialized db object eventually calling db.create_all to create the database from my model(s).
In order for this to work I have to import any model I may have into the create_app function. This isn't problematic for a small database with a few tables, but if I have a database with a large number of tables it seems like there should be a better way. from app.models import *
doesn't work inside functions, so I have to ask is there another way to manage this?