Guest User

Untitled

a guest
Dec 13th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. # This must be contained in a function so we can call it with Zappa
  2. def db_init():
  3. from project import create_app, db
  4.  
  5. app = create_app()
  6. app.app_context().push()
  7.  
  8. from project.models.model1 import Model1
  9.  
  10. # if you have more models just add them here
  11. # from project.models.model2 import Model2
  12. # from project.models.lots_of_models import Model3, Model4, Model5
  13.  
  14. db.create_all()
  15.  
  16.  
  17. if __name__ == "__main__":
  18. db_init()
Add Comment
Please, Sign In to add comment