Fixes for fix a warning about registering blueprints
This commit is contained in:
parent
8c2bcdc74a
commit
dfbdc7109f
4 changed files with 25 additions and 13 deletions
|
|
@ -38,11 +38,13 @@ def start_app():
|
|||
for key_app, added_app in config.apps.items():
|
||||
|
||||
controller_path=import_module(added_app[0])
|
||||
|
||||
|
||||
controller_base=os.path.dirname(controller_path.__file__)
|
||||
|
||||
dir_controllers=os.listdir(controller_base)
|
||||
|
||||
app_name=getattr(controller_path, added_app[1])
|
||||
|
||||
for controller in dir_controllers:
|
||||
|
||||
if controller.find('.py')!=-1 and controller.find('__init__')==-1:
|
||||
|
|
@ -50,15 +52,12 @@ def start_app():
|
|||
controller_py=controller.replace('.py', '')
|
||||
|
||||
module_app=added_app[0]+'.'+controller_py
|
||||
|
||||
|
||||
a=import_module(module_app)
|
||||
|
||||
app_name=getattr(a, added_app[1])
|
||||
|
||||
app.register_blueprint(app_name, url_prefix=added_app[2])
|
||||
|
||||
arr_module_path[key_app]=os.path.dirname(sys.modules[module_app].__file__)
|
||||
|
||||
|
||||
app.register_blueprint(app_name, url_prefix=added_app[2])
|
||||
|
||||
"""
|
||||
module_app=config.apps[added_app][0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue