Application settings helper for Django apps.
Project description
Django AppSettings
Application settings helper for Django apps.
Why another app settings app? Because none of the other suited my needs!
This one will be simple to use, and will work with unit tests overriding settings.
(Future) Usage
This app is an alpha version. Development has just started. I want it to be something like that:
# in your application __init__.py
from appsettings import AppSettingsHelper as Ash
class AppSettings(Ash):
always_use_ice_cream = Ash.BooleanSetting(default=True)
attr_name = Ash.StringSetting(name='SETTING_NAME')
# if you have complex treatment to do on setting
complex_setting = Ash.Setting(getter=custom_method, checker=custom_checker)
# if you need to import a python object (module/class/method)
imported_object = Ash.ImportedObjectSetting(default='app.default.object')
class Meta:
settings_prefix = 'ASH' # settings must be prefixed with ASH_
AppSettings.check() # will check every settings
# then in your code
from . import AppSettings
app_settings = AppSettings()
app_settings.load() # to load every settings once and for all
app_settings.attr_name == 'something'
# or, and in order to work with tests overriding settings
AppSettings.get_always_use_ice_cream() # to get ASH_ALWAYS_USE_ICE_CREAM setting dynamically
my_python_object = AppSettings.get_imported_object()
License
Software licensed under ISC license.
Installation
pip install django-app-settings
Documentation
Development
To run all the tests: tox
Changelog
0.1.0 (2017-03-23)
Alpha release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-app-settings-0.1.0.tar.gz
(12.2 kB
view hashes)
Built Distribution
Close
Hashes for django-app-settings-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c1013d2a032712017aee7148b3c707b42523632a716c5cbd30f532a950dc5ff |
|
MD5 | 8a7f38964de956b1cd7328f06ed59640 |
|
BLAKE2b-256 | e6629ab6421fdc6b05ac73eca035d2fadd42e5624a7bc14d7c862c97699cf54b |
Close
Hashes for django_app_settings-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9abdd4fafb89e3945a2c41389a82b7f0bf6729ae5a4c1358e589ec905f979707 |
|
MD5 | a2f1e10d502678174404c2c3a12f74f2 |
|
BLAKE2b-256 | 7a8864cd8c71170750554bc87d37b1ea18fe92581460e674dd0b74eaf532e395 |