Support for required settings in get_config function.

Issue #13 new
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', '') """ }}}

Comments (0)

  1. Log in to comment