skip to navigation
skip to content

django-hateconf 0.2.3

Application for distribuited configurations in django

Application for distribuited configurations in django

usage:
    1. Install django-hateconf in your enviroment (or copy this folder in your
       django project root.
    2. Add 'django_hateconf' in yours settings.py INSTALLED_APPS.
    3. Add in your project's settings.py a dictionary "SETTINGS_BIND":

        SETTINGS_BIND = {
            "file":
                "path/to/settings.<yaml|yml|json|xml|cfg|ini>",
            "bind":
                ("list or tuple", "of names", "of existing", "vars in",
                  "settings.py to, bind),
            "header":
                "header of your settings file (optional)"
        }

        The keys

            file: absolute path to the file that contains the variable binds
                  for settings.py.
                  The file extention must be (case INsensitive):

                      * ".yml" or ".yaml" for YAML (<http://yaml.org/) file
                      type. (pyyaml must be installed: http://pyyaml.org/)

                      * ".json" for JSON (http://www.json.org/) file type.

                      * ".xml" for XML (http://www.w3.org/XML/) file type.

                      * ".cfg" or ".ini" for file consists of sections, lead by
                        a "[section]" header, and followed by "name: value"
                        entries, with continuations and such in the style of
                        RFC 822.

            bind: List of EXISTING settings.py vars for binding.

            header: Optional header for binds file.

    4. Add in the end of settings.py file this 2 lines:

        import django_hateconf
        django_hateconf.patch(locals())

    5. Run:
        $ python manage.py settings --sync

    6. ENJOY!

For more usages see after the 6 steps:

    python manage.py settings --help