Ejemplo n.º 1
0
def make_wsgi(profile='Default'):

    config.appinit(settingsmod, profile)

    app = WSGIApp()

    app = ElixirApp(app)

    app = SessionMiddleware(app, **dict(settings.beaker))

    app = RegistryManager(app)

    # serve static files from main app and supporting apps (need to reverse order b/c
    # middleware stack is run in bottom up order).  This works b/c if a
    # static file isn't found, the ShardDataMiddleware just forwards the request
    # to the next app.
    for appname in config.appslist(reverse=True):
        app_py_mod = __import__(appname)
        fs_static_path = path.join(path.dirname(app_py_mod.__file__), 'static')
        static_map = {routing.add_prefix('/'): fs_static_path}
        app = SharedDataMiddleware(app, static_map)

    # show nice stack traces and debug output if enabled
    if settings.debugger.enabled:
        app = DebuggedApplication(app, evalex=settings.debugger.interactive)

    return app
Ejemplo n.º 2
0
def make_wsgi(profile='Default'):

    app = WSGIApp(settingsmod, profile)

    # can't run this until after the app is initilized or else the
    # app globals are not setup
    from compstack.sqlalchemy.lib.middleware import SQLAlchemyApp
    app = SQLAlchemyApp(app)

    return full_wsgi_stack(app)
Ejemplo n.º 3
0
def make_wsgi(profile='Dev'):
    app = WSGIApp(settingsmod, profile)

    app = SQLAlchemyApp(app)

    # has to happen after the db global gets setup and is needed b/c of our
    # use of @asview
    visitmods('views')

    return full_wsgi_stack(app)
Ejemplo n.º 4
0
def make_wsgi(profile='Default'):
    app = WSGIApp(settingsmod, profile)
    app = full_wsgi_stack(app)
    return app
Ejemplo n.º 5
0
def make_wsgi(profile='Dev'):
    app = WSGIApp(settingsmod, profile)

    app = SQLAlchemyApp(app)

    return full_wsgi_stack(app)
Ejemplo n.º 6
0
def make_wsgi(profile='Default'):
    app = WSGIApp(settingsmod, profile)
    # wrap our app in middleware and return
    return full_wsgi_stack(app)
Ejemplo n.º 7
0
def make_wsgi(profile='Default', use_session=True):
    app = WSGIApp(settingsmod, profile)
    if not use_session:
        app.settings.beaker.enabled = False
    return full_wsgi_stack(app)
Ejemplo n.º 8
0
from os import path
from blazeweb.application import WSGIApp
from blazeweb.config import DefaultSettings
from blazeweb.middleware import minimal_wsgi_stack


class Settings(DefaultSettings):
    def init(self):
        self.dirs.base = path.dirname(__file__)
        self.app_package = path.basename(self.dirs.base)
        DefaultSettings.init(self)
        self.auto_load_views = True

        # don't use exception catching, debuggers, logging, etc.
        self.apply_test_settings()

    def get_storage_dir(self):
        return path.join(self.dirs.base, '..', '..', 'test-output',
                         self.app_package)


settings = Settings()

app = WSGIApp(settings)
wsgiapp = minimal_wsgi_stack(app)
Ejemplo n.º 9
0
from blazeweb.application import WSGIApp
from blazeweb.middleware import minimal_wsgi_stack
import minimal3.settings as settingsmod

app = WSGIApp(settingsmod, 'Settings')
wsgiapp = minimal_wsgi_stack(app)
Ejemplo n.º 10
0
def make_wsgi(settings_cls=Testruns, **kwargs):
    return WSGIApp(settings_cls())