Exemplo n.º 1
0
 def _build(self, main, api_url):
     self.root = main
     self.api_url = api_url
     config = dict(default_config(main))
     config.update(
         SESSION_COOKIE_NAME='%s-app' % self.name,
         HTML_TITLE=self.name
     )
     extend_config(config, self.config)
     config.update(
         APPLICATION_ID=self.id,
         SECRET_KEY=self.secret,
         APP_NAME=self.name,
         API_URL=api_url,
         APP_MULTI=self,
         MINIFIED_MEDIA=main.config['MINIFIED_MEDIA'],
         DEFAULT_CONTENT_TYPE="text/html"
     )
     # Fire the multi app event
     main.fire('on_multi_app', config)
     application = execute_from_config(
         main.config_module,
         argv=['serve'],
         config=config,
         cmdparams=dict(
             start=False,
             get_app=True
         )
     )
     return application
Exemplo n.º 2
0
def default_config(app):
    """Build the default config for all applications
    """
    config = dict(
        AUTHENTICATION_BACKENDS=["lux.extensions.applications:MultiBackend"],
        EXTENSIONS=[
            'lux.extensions.base', 'lux.extensions.rest',
            'lux.extensions.applications'
        ])
    if app.config['SETTINGS_DEFAULT_FILE']:
        with open(app.config['SETTINGS_DEFAULT_FILE']) as fp:
            extend_config(config, json.load(fp))
    return config
Exemplo n.º 3
0
def default_config(app):
    """Build the default config for all applications
    """
    config = dict(
        AUTHENTICATION_BACKENDS=[
            "lux.extensions.applications:MultiBackend"
        ],
        EXTENSIONS=[
            'lux.extensions.base',
            'lux.extensions.rest',
            'lux.extensions.applications'
        ]
    )
    if app.config['SETTINGS_DEFAULT_FILE']:
        with open(app.config['SETTINGS_DEFAULT_FILE']) as fp:
            extend_config(config, json.load(fp))
    return config
Exemplo n.º 4
0
 def _build(self, main, api_url):
     self.root = main
     self.api_url = api_url
     config = dict(default_config(main))
     config.update(SESSION_COOKIE_NAME='%s-app' % self.name,
                   HTML_TITLE=self.name)
     extend_config(config, self.config)
     config.update(APPLICATION_ID=self.id,
                   SECRET_KEY=self.secret,
                   APP_NAME=self.name,
                   API_URL=api_url,
                   APP_MULTI=self,
                   MINIFIED_MEDIA=main.config['MINIFIED_MEDIA'],
                   DEFAULT_CONTENT_TYPE="text/html")
     # Fire the multi app event
     main.fire('on_multi_app', config)
     application = execute_from_config(main.config_module,
                                       argv=['serve'],
                                       config=config,
                                       cmdparams=dict(start=False,
                                                      get_app=True))
     return application