1. Shmigelsky Andrey
  2. django-annoying
  3. Issues
Issue #13 new

Support for required settings in get_config function.

Anonymous created an issue

Simply make {{{get_config}}} a partial call of {{{getattr}}} function.

{{{ try: from functools import partial except ImportError: from django.utils.functional import curry as partial # Python 2.3, 2.4 fallback.

get_config = partial(getattr, settings) """ Get settings from django.conf if exists, otherwise return default value if given or raise AttributeError if default value not given.


ADMIN_EMAIL = get_config('ADMIN_EMAIL', 'default@email.com') """ }}}

Comments (0)

  1. Log in to comment