django-appsettings 0.1.1

A unified settings system for pluggable Django apps

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
BSD License 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
Jared Forsyth
HOMEPAGE:
github.com
CATEGORY:
ROOT \ Internet \ HTTP (WWW)
django-appsettings is a unified system for pluggable apps to have configurable settings. The django-appsettings app provides a clean API for keeping track of settings, and, most importantly, having settings that are configurable for a user that does not have write access to your server appsettings also provides an interface (similar to the admin interface for models) for editing these settings.

Usage:

So you want to use this in your app? Well, just create a settings.py for your app (which will be autodiscovered by _appsettings_) and register your settings. Example:

import appsettings
from appsettings import values
register = appsettings.register('mymodule')

# settings are organized into groups.
# this will define settings
# mymodule.story.greeting,
# mymodule.story.pigs,
# etc.
@register
class Story:
 # int, string, and float types are auto-discovered.
 greeting = "hello"
 pigs = 3
 wolves = 1
 # or you can specify the type
 houses = valuse.IntValue(3, doc = "number of houses in which to hide")
 myhouse = values.ChoiceValue(['straw','sticks','bricks'], 'straw')


using the settings in the rest of your app couldn't be easier:

from appsettings import settings.mymodule as settings

def run_away():
 return "%s pigs are running into a house made of %s"
 %(settings.story.pigs, settings.story.myhouse)


more thorough documentation (hopefully sphinx-pretty API docs) to come shortly.

Last updated on July 15th, 2010

requirements

#server appsettings #Django appsettings #unified settings #Django #server #appsettings #unified

Add your review!

SUBMIT