Port variant py39
Summary Django configure defaults helper class (3.9)
Package version 1.0.5
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py310
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 20 NOV 2021, 04:14:38 UTC
Port created 02 FEB 2018, 15:29:04 UTC
Subpackage Descriptions
single 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: 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 ```` 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 `` 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 `` would override SETTING_1 of the above MyAppConf``: .. code-block:: python ACME_SETTING_1 = "uno" Since django-appconf completes Django's global settings with its default values (like "one" above), the standard ``python diffsettings`` will show these defaults automatically. 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 `` file of your app package and import django.conf.settings`` in it, too:
Configuration Switches (platform-specific settings discarded)
PY310 OFF Build using Python 3.10 PY39 ON Build using Python 3.9
Package Dependencies by Type
Build (only) python-pip:single:py39
Build and Runtime python39:single:standard
Runtime (only) python-Django:single:py39
Download groups
main mirror://PYPIWHL/48/95/78c279b7861efd8b0282e9373d40ec7247664bf1246a6cdc9e59d281ceb0
Distribution File Information
ae9f864ee1958c815a965ed63b3fba4874eec13de10236ba063a788f9a17389d 6433 django_appconf-1.0.5-py3-none-any.whl
Ports that require python-django-appconf:py39
python-django-compressor:py39 Django CSS/JS cache and compressor (3.9)