# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-django-appconf VERSION= 1.0.3 KEYWORDS= python devel VARIANTS= py36 py37 SDESC[py36]= Django configure defaults helper class (PY 36) SDESC[py37]= Django configure defaults helper class (PY 37) HOMEPAGE= https://django-appconf.readthedocs.io/ CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPI/d/django-appconf DISTFILE[1]= django-appconf-1.0.3.tar.gz:main DF_INDEX= 1 SPKGS[py36]= single SPKGS[py37]= single OPTIONS_AVAILABLE= PY36 PY37 OPTIONS_STANDARD= none VOPTS[py36]= PY36=ON PY37=OFF VOPTS[py37]= PY36=OFF PY37=ON DISTNAME= django-appconf-1.0.3 GENERATED= yes [PY36].BUILDRUN_DEPENDS_ON= python-Django:single:py36 python-six:single:py36 [PY36].USES_ON= python:py36 [PY37].BUILDRUN_DEPENDS_ON= python-Django:single:py37 python-six:single:py37 [PY37].USES_ON= python:py37 [FILE:3243:descriptions/desc.single] django-appconf ============== .. image:: http://codecov.io/github/django-compressor/django-appconf/coverage.svg?bran ch=develop :alt: Code Coverage :target: http://codecov.io/github/django-compressor/django-appconf?branch=develop .. image:: https://secure.travis-ci.org/django-compressor/django-appconf.svg?branch=de velop :alt: Build Status :target: http://travis-ci.org/django-compressor/django-appconf A helper class for handling configuration defaults of packaged Django apps gracefully. .. note:: This app precedes Django's own AppConfig_ classes that act as "objects [to] store metadata for an application" inside Django's app loading mechanism. In other words, they solve a related but different use case than django-appconf and can't easily be used as a replacement. The similarity in name is purely coincidental. .. _AppConfig: https://docs.djangoproject.com/en/stable/ref/applications/#django.apps.AppC onfig Overview -------- Say you have an app called ``myapp`` with a few defaults, which you want to refer to in the app's code without repeating yourself all the time. ``appconf`` provides a simple class to implement those defaults. Simply add something like the following code somewhere in your app files: .. code-block:: python from appconf import AppConf class MyAppConf(AppConf): SETTING_1 = "one" SETTING_2 = ( "two", ) .. note:: ``AppConf`` classes depend on being imported during startup of the Django process. Even though there are multiple modules loaded automatically, only the ``models`` modules (usually the ``models.py`` file of your app) are guaranteed to be loaded at startup. Therefore it's recommended to put your ``AppConf`` subclass(es) there, too. The settings are initialized with the capitalized app label of where the setting is located at. E.g. if your ``models.py`` with the ``AppConf`` class is in the ``myapp`` package, the prefix of the settings will be ``MYAPP``. You can override the default prefix by specifying a ``prefix`` attribute of an inner ``Meta`` class: .. code-block:: python from appconf import AppConf class AcmeAppConf(AppConf): SETTING_1 = "one" SETTING_2 = ( "two", ) class Meta: prefix = 'acme' The ``MyAppConf`` class will automatically look at Django's global settings to determine if you've overridden it. For example, adding this to your site's ``settings.py`` would override ``SETTING_1`` of the above ``MyAppConf``: .. code-block:: python ACME_SETTING_1 = "uno" In case you want to use a different settings object instead of the default ``'django.conf.settings'``, set the ``holder`` attribute of the inner ``Meta`` class to a dotted import path: .. code-block:: python from appconf import AppConf class MyAppConf(AppConf): SETTING_1 = "one" SETTING_2 = ( "two", ) class Meta: prefix = 'acme' holder = 'acme.conf.settings' If you ship an ``AppConf`` class with your reusable Django app, it's recommended to put it in a ``conf.py`` file of your app package and import ``django.conf.settings`` in it, too: [FILE:106:distinfo] 35f13ca4d567f132b960e2cd4c832c2d03cb6543452d34e29b7ba10371ba80e3 14904 django-appconf-1.0.3.tar.gz