diff --git a/init_db.py b/init_db.py index f57e56b..ea57a7c 100755 --- a/init_db.py +++ b/init_db.py @@ -1,9 +1,10 @@ #!/usr/bin/env python3 -from flaskapp import db +from taskmanager import db, app print('[i] Trying to create databse...') try: - db.create_all() + with app.app_context(): + db.create_all() print('[+] Success you can proceed with deployment!') except: print('[-] Creating db failed :/') diff --git a/run.py b/run.py index a64dc5f..80db040 100755 --- a/run.py +++ b/run.py @@ -1,4 +1,5 @@ -from flaskapp import app +#!/usr/bin/env python3 +from taskmanager import app if __name__ == '__main__': app.run(debug=False)