diff --git a/app.py b/app.py index 85345e1..0a00714 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,4 @@ -from truthseeker import app # the variable 'app' is detected by `flask run` +from truthseeker import APP as app # the variable 'app' is detected by `flask run` if __name__ == "__main__": app.run() diff --git a/tests/test_api.py b/tests/test_api.py index 4235864..f4924ae 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,8 +1,8 @@ import json import pytest -from truthseeker import app +from truthseeker import APP -test_app = app.test_client() +test_app = APP.test_client() class TestException(Exception): __test__ = False diff --git a/truthseeker/__init__.py b/truthseeker/__init__.py index 2036856..6229d31 100644 --- a/truthseeker/__init__.py +++ b/truthseeker/__init__.py @@ -29,7 +29,9 @@ class TruthSeekerApp(flask.Flask): f.close() print("Generated secret and wrote to secret.txt !") -app = TruthSeekerApp() +APP = TruthSeekerApp() -app.register_blueprint(routes_api.routes_api, url_prefix="/api/v1") -app.register_blueprint(routes_ui.routes_ui, url_prefix="/") +from truthseeker.routes import routes_api, routes_ui + +APP.register_blueprint(routes_api.routes_api, url_prefix="/api/v1") +APP.register_blueprint(routes_ui.routes_ui, url_prefix="/")