Commits

Anton Shestakov committed e1e43c8

Use @app.before_first_request instead of calling init_db() explicitly (so autogenerated wsgi.py files will just work).

  • Participants
  • Parent commits 716c65a

Comments (0)

Files changed (2)

 cdb = None
 
 
+@app.before_first_request
 def init_db():
     global cdb
     
 
 
 if __name__ == '__main__':
-    init_db()
     app.run()
 from itertools import chain
 from unittest import TestCase, main
 
-from app import app, init_db
+from app import app
 
 
 class BaseTestCase(TestCase):
 if __name__ == '__main__':
     app.config['TESTING'] = True
     app.config['DATABASE'] = 'test_db'
-    init_db()
     main()