django.conf.Settings

Here are the examples of the python api django.conf.Settings taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: django-rocket-engine Source File: on_appengine.py
    def reload_settings(self):
        settings_module = os.environ["DJANGO_SETTINGS_MODULE"]

        mod = importlib.import_module(settings_module)
        reload(mod)
        settings._wrapped = Settings(settings_module)

Example 2

Project: menagerie Source File: helpers.py
def configure(module=None, client=KazooClient, holder=ZooKeeperSettingsHolder):
    if module is None:
        try:
            module = os.environ[ENVIRONMENT_VARIABLE]
            if not module:
                raise KeyError
        except KeyError:
            raise ImproperlyConfigured('%s is not defined, cannot import settings')

    __settings = Settings(module)

    hosts = ','.join(__settings.ZOOKEEPER_HOSTS)
    if hasattr(__settings, 'ZOOKEEPER_SETTINGS_NAMESPACE'):
        hosts = '/'.join((hosts, __settings.ZOOKEEPER_SETTINGS_NAMESPACE))

    logger.debug('Attempting to connect to ZooKeeper at "%s"...', hosts)
    zookeeper = client(hosts=hosts)
    zookeeper.start()

    settings.configure(holder(zookeeper, defaults=__settings))