def get_app(debug=None, settings_file='', compressed_static=None, settings=settings): """ Return a tuple (settings, app) configured using passed parameters and/or a setting file. """ if settings_file: settings.update_with_file(os.path.abspath(settings_file)) if settings.PASTE_ID_LENGTH < 4: raise SettingsValidationError('PASTE_ID_LENGTH cannot be lower than 4') if compressed_static is not None: settings.COMPRESSED_STATIC_FILES = compressed_static if debug is not None: settings.DEBUG = debug # make sure the templates can be loaded for d in reversed(settings.TEMPLATE_DIRS): bottle.TEMPLATE_PATH.insert(0, d) if settings.DEBUG: bottle.debug(True) return settings, app
def get_app(debug=None, settings_file='', compressed_static=None, settings=settings): """ Return a tuple (settings, app) configured using passed parameters and/or a setting file. """ settings_file = settings_file or os.environ.get('ZEROBIN_SETTINGS_FILE') if settings_file: settings.update_with_file(os.path.realpath(settings_file)) if settings.PASTE_ID_LENGTH < 4: raise SettingsValidationError('PASTE_ID_LENGTH cannot be lower than 4') if compressed_static is not None: settings.COMPRESSED_STATIC_FILES = compressed_static if debug is not None: settings.DEBUG = debug # make sure the templates can be loaded for d in reversed(settings.TEMPLATE_DIRS): bottle.TEMPLATE_PATH.insert(0, d) if settings.DEBUG: bottle.debug(True) return settings, app
def get_app(debug=None, settings_file='', settings=settings): """ Return a tuple (settings, app) configured using passed parameters and/or a setting file. """ if settings_file: settings.update_with_file(os.path.abspath(settings_file)) if debug is not None: settings.DEBUG = debug # make sure the templates can be loaded for d in reversed(settings.TEMPLATE_DIRS): bottle.TEMPLATE_PATH.insert(0, d) if settings.DEBUG: bottle.debug(True) return settings, app
def get_app(debug=None, settings_file='', compressed_static=None): """ Return a tuple (settings, app) configured using passed parameters and/or a setting file. """ if settings_file: settings.update_with_file(os.path.abspath(settings_file)) if compressed_static is not None: settings.COMPRESSED_STATIC_FILES = compressed_static if debug is not None: settings.DEBUG = debug # make sure the templates can be loaded for d in reversed(settings.TEMPLATE_DIRS): bottle.TEMPLATE_PATH.insert(0, d) if settings.DEBUG: bottle.debug(True) return settings, app
def get_app(debug=None, settings_file='', compressed_static=None): """ Return a tuple (settings, app) configured using passed options and a setting file. """ if settings_file: settings.update_with_file(os.path.abspath(settings_file)) if compressed_static is not None: settings.COMPRESSED_STATIC_FILES = compressed_static if debug is not None: settings.DEBUG = debug # make sure the templates can be loaded for d in reversed(settings.TEMPLATE_DIRS): bottle.TEMPLATE_PATH.insert(0, d) if settings.DEBUG: bottle.debug(True) return settings, app