diff --git a/paramecio/citoplasma/urls.py b/paramecio/citoplasma/urls.py index 33af025..b05904a 100644 --- a/paramecio/citoplasma/urls.py +++ b/paramecio/citoplasma/urls.py @@ -38,7 +38,7 @@ def make_url(path, query_args={}): get_query='?'+urllib.parse.urlencode(query_args) return config.base_url+path+get_query - + def make_url_domain(path, query_args={}): """ diff --git a/paramecio/index.py b/paramecio/index.py index 7c78617..f57610a 100644 --- a/paramecio/index.py +++ b/paramecio/index.py @@ -77,6 +77,39 @@ def prepare_app(): """ + app_mounts={} + + 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) + + for controller in dir_controllers: + + if controller.find('.py')!=-1 and controller.find('__init__')==-1: + + 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]) + + #app.mount(added_app[2], app_name) + app_mounts[added_app[2]]=app_name + + arr_module_path[key_app]=os.path.dirname(sys.modules[module_app].__file__) + + for k_app,v_app in app_mounts.items(): + + app.mount(k_app, v_app) + set_timezone() if error_reporting: