Did I find the right examples for you? yes no

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)
Get a setting from ``dash.contrib.plugins.weather`` conf module, falling back to the default.

If override is not None, it will be used instead of the setting.

:param setting: String with setting name
:param override: Value to use when no setting is available. Defaults to None.
:return: Setting value.

        def get_setting(setting, override=None):
    """
    Get a setting from ``dash.contrib.plugins.weather`` conf module, falling back to the default.

    If override is not None, it will be used instead of the setting.

    :param setting: String with setting name
    :param override: Value to use when no setting is available. Defaults to None.
    :return: Setting value.
    """
    if override is not None:
        return override
    if hasattr(settings, 'DASH_PLUGIN_WEATHER_{0}'.format(setting)):
        return getattr(settings, 'DASH_PLUGIN_WEATHER_{0}'.format(setting))
    else:
        return getattr(defaults, setting)
        


src/d/j/django-dash-0.4.4/src/dash/contrib/plugins/weather/settings.py   django-dash(Download)
__all__ = ('API_KEY', 'API_ENDPOINT_URL', 'DEFAULT_SHOW_TITLE', 'DEFAULT_CACHE_FOR')
 
from dash.contrib.plugins.weather.conf import get_setting
 
API_KEY = get_setting('API_KEY')
API_ENDPOINT_URL = get_setting('API_ENDPOINT_URL')
DEFAULT_SHOW_TITLE = get_setting('DEFAULT_SHOW_TITLE')
DEFAULT_CACHE_FOR = get_setting('DEFAULT_CACHE_FOR')

src/d/j/django-dash-HEAD/src/dash/contrib/plugins/weather/settings.py   django-dash(Download)
__all__ = ('API_KEY', 'API_ENDPOINT_URL', 'DEFAULT_SHOW_TITLE', 'DEFAULT_CACHE_FOR')
 
from dash.contrib.plugins.weather.conf import get_setting
 
API_KEY = get_setting('API_KEY')
API_ENDPOINT_URL = get_setting('API_ENDPOINT_URL')
DEFAULT_SHOW_TITLE = get_setting('DEFAULT_SHOW_TITLE')
DEFAULT_CACHE_FOR = get_setting('DEFAULT_CACHE_FOR')