# app is a variable inside the file __init__.py in side of # the app_folder directory. from app_folder import app app.run(debug=True)
"""Project Entry Point.""" import sys from app_folder import app, db if __name__ == '__main__': if '--setup' in sys.argv: with app.app_context(): db.create_all() db.session.commit() print("Database tables created") else: app.run(host='localhost', port=5000)
from app_folder import app app.run()
#!flask/bin/python3 import time import logging from app_folder import app logging.basicConfig(level=logging.INFO) # while True: try: app.run(host="0.0.0.0", port=5000, debug=True) except KeyboardInterrupt: logging.info("The module was stopped") except Exception as err: logging.exception("The module was failed {}".format(err)) finally: time.sleep(1)
#! /usr/bin/env python from app_folder import app app.run(host='0.0.0.0', port=5000, debug=True)