Fix in modules loading

This commit is contained in:
Antonio de la Rosa 2024-05-04 01:05:19 +02:00
parent f993143936
commit 91b7bc6f79

View file

@ -74,7 +74,7 @@ def start_app():
# Load blueprints # Load blueprints
for key_app, added_app in config.apps.items(): for key_app, added_app in config.apps.items():
controller_path=import_module(added_app[0]) controller_path=import_module(added_app[0])
controller_base=os.path.dirname(controller_path.__file__) controller_base=os.path.dirname(controller_path.__file__)
@ -83,6 +83,11 @@ def start_app():
app_name=getattr(controller_path, added_app[1]) 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: for controller in dir_controllers:
if controller.find('.py')!=-1 and controller.find('__init__')==-1: if controller.find('.py')!=-1 and controller.find('__init__')==-1:
@ -93,7 +98,8 @@ def start_app():
a=import_module(module_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=='/': if config.application_root=='/':
app.register_blueprint(app_name, url_prefix=added_app[2]) app.register_blueprint(app_name, url_prefix=added_app[2])
else: else: