Per-app default settings for Django
Where you would usually do something like:
from django.conf import settings getattr(settings, "MY_SETTING", "DEFAULT")
Create a settings.py file in your app, containing:
MY_SETTING = "DEFAULT"
and do something like:
from djappsettings import settings settings.MY_SETTING
If you’d like to support this module where available, but fall back to the usual method if not, just try it:
try: from djappsettings import settings except: from django.conf import settings settings.MY_SETTING
$ pip install djappsettings
$ git clone git://github.com/adammck/djappsettings.git $ python djangoappsettings/setup.py install
Install tox and run the tests:
$ git clone git://github.com/adammck/djappsettings.git $ pip install tox $ cd djappsettings $ tox
This was created to scratch an itch for the RapidSMS project. I hope it will be useful to you. Use it at your own risk. (But do use it, because it’s way better.)
Patches and pull requests are very welcome. Please file bugs on GitHub.
djappsettings is free software, available under the BSD license.