From 91b7bc6f79847a2499ec821f4f7e344f1fbc774c Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Sat, 4 May 2024 01:05:19 +0200 Subject: [PATCH] Fix in modules loading --- paramecio2/app.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/paramecio2/app.py b/paramecio2/app.py index e42cd71..6221ee5 100644 --- a/paramecio2/app.py +++ b/paramecio2/app.py @@ -74,7 +74,7 @@ def start_app(): # Load blueprints for key_app, added_app in config.apps.items(): - + controller_path=import_module(added_app[0]) controller_base=os.path.dirname(controller_path.__file__) @@ -83,6 +83,11 @@ def start_app(): app_name=getattr(controller_path, added_app[1]) + #print(os.path.dirname(sys.modules[added_app[0]].__file__)) + #print(key_app) + + arr_module_path[key_app]=os.path.dirname(sys.modules[added_app[0]].__file__) + for controller in dir_controllers: if controller.find('.py')!=-1 and controller.find('__init__')==-1: @@ -93,7 +98,8 @@ def start_app(): a=import_module(module_app) - arr_module_path[key_app]=os.path.dirname(sys.modules[module_app].__file__) + #arr_module_path[key_app]=os.path.dirname(sys.modules[module_app].__file__) + if config.application_root=='/': app.register_blueprint(app_name, url_prefix=added_app[2]) else: