<commit_before>django-classy-settings
======================

Minimalist approach to class-based settings for Django

https://django-classy-settings.readthedocs.io/en/latest/<commit_msg>Expand README<commit_after>django-classy-settings
======================

Minimalist approach to class-based settings for Django

https://django-classy-settings.readthedocs.io/en/latest/


Quick Start
-----------

In your `settings.py`

    from cbs import BaseSettings, env


    ...
    # For env settings with a DJANGO_ prefix
    denv = env(prefix='DJANGO_')

    class Settings(BaseSettings):

        DEBUG = denv.bool(True)  # Controlled by DJANGO_DEBUG

        DEFAULT_DATABASE = denv.dburl('sqlite://db.sqlite')

        def DATABASES(self):
            return {
                'default': self.DEFAULT_DATABASE,
            }


    class ProdSettings(Settings):
        DEBUG = False

        @env
        def STATIC_ROOT(self):
            raise ValueError("Must set STATIC_ROOT!")

    __getattr__ = BaseSettings.use()
{'fraction_non_alphanumeric': 0.14355948869223206, 'fraction_numerical': 0.0, 'mean_word_length': 2.77037037037037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6998113', 'n_tokens_mistral': 318, 'n_tokens_neox': 295, 'n_words': 64}