This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

DjAppSettings: Per-App Settings for Django

  • I hate pasting blobs into my settings.py every time I enable an app.
  • This is a Python module which provides a sane way for reusable Django apps to configure themselves.
  • It’s a drop-in replacement for the django.conf.settings class. You can fetch all of your project, app, and global default settings via a single settings object.
  • It doesn’t touch your project’s settings module, and existing Django apps are free to ignore it. Your app can even fall back to the usual method if this module isn’t available.
  • App settings are prevented from clobbering built-in settings. They can only add settings.
  • Project settings (in DJANGO_SETTINGS_MODULE) override app settings.
  • Using per-app prefixes is a good idea, but not mandatory.

But, but

  • I’m aware of Jared Forsyth’s django-appsettings, and I think it’s lovely but wrong. Project settings should not be editable in the Django admin.
  • I’m also aware that this feature has been rejected numerous times on the Django trac. But pasting a bunch of junk into my settings.py each time I add an app is a pain in the ass.
  • Checking for a setting (via settings.hasattr), and falling back to a hard-coded default value is a terrible solution, because your defaults are duplicated and buried. They should be easily discoverable.

Usage

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

Installation

Via Pip:

$ pip install djappsettings

Via GitHub:

$ git clone git://github.com/adammck/djappsettings.git
$ python djangoappsettings/setup.py install

Testing

Install tox and run the tests:

$ git clone git://github.com/adammck/djappsettings.git
$ pip install tox
$ cd djappsettings
$ tox

Bugs?

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.

License

djappsettings is free software, available under the BSD license.

Release History

Release History

0.4.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
djappsettings-0.4.0.tar.gz (4.5 kB) Copy SHA256 Checksum SHA256 Source Aug 7, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting