from app import create_app app = create_app() # <-- moved here if __name__ == '__main__': app.run(debug=True, port=5000)