def _registerApps(app):
    '''
	Dynamic Loading:
		Add an entry to "APPS" in settings.py.
		Note: 
			url_prefix and subdomain params should be handled in the respecting
			sub application (where module is kept). 
	
	Manual Loading:
		from myapp.apps.frontend.views import frontend_module
		app.register_module(frontend_module, url_prefix='/frontend')
		
		Setting of the url_prefix and subdomain params here will override
		the values set in the sub application module.
		
		Examples:
		
			app.register_module(app_module.module, url_prefix=app_prefix)
			app.register_module(app_module.module, subdomain=app_name)
			app.register_module(app_module.module, url_prefix=app_prefix, subdomain=app_name) 
    '''

    for app_name in settings.APPS:
        fq_app_name = ("myapp.apps.%s" % app_name) #TODO: dump myapp from settings
        app_module = __import__((fq_app_name), globals(), locals(), [ ("%s_module" % app_name) ])

        if hasattr(app_module, "module"):
            app.register_module(app_module.module)
        else:
            print("Missing attribute! Python object [%s.module] does not exist. Not registering app!" % fq_app_name)
dataset/ETHPy150Open JasonGiedymin/Flask-Module-Scaffold/src/myapp/__init__.py/_registerApps/original