def paths(self): config = ConfigRunner() path_info = {} path_info.update(settings.get('servingfiles', {})) # Media files media_url = config.media_url media_root = config.media_root if media_url and media_root: path_info.update({ media_url: media_root }) # Static files static_url = config.static_url static_root = config.static_root if static_url and static_root: path_info.update({ static_url: static_root }) return path_info
def expires(self): session_settings = settings.get('sessions') if session_settings is not None: # Getting the expires function expires_func = None expires = session_settings.get('expires', '') if expires: if isinstance(expires, str): try: expires = import_object(expires) except ImportError as error: raise InvalidSessionSettingsException(error) if callable(expires): expires_func = expires else: raise InvalidSessionSettingsException( "'expires' setting is not callable" ) return expires_func or expires return ''
def httponly(self): session_settings = settings.get('sessions') if session_settings is not None: return session_settings.get('httponly', '') or '' return ''
def version(self): session_settings = settings.get('sessions') if session_settings is not None: return session_settings.get('version', '') or '' return ''
def secure(self): session_settings = settings.get('sessions') if session_settings is not None: return session_settings.get('secure', '') or '' return ''
def max_age(self): session_settings = settings.get('sessions') if session_settings is not None: return session_settings.get('max_age', '') or '' return ''
def domain(self): session_settings = settings.get('sessions') if session_settings is not None: return session_settings.get('domain', '') or '' return ''
def comment(self): session_settings = settings.get('sessions') if session_settings is not None: return session_settings.get('comment', '') or '' return ''
def path(self): session_settings = settings.get('sessions') if session_settings is not None: return session_settings.get('path', '') or '' return ''