Пример #1
0
def __readConfig(path):
    p = Properties()
    p.load(path)
    for kv in p.list():
        key = __toHump(kv[0])
        value = kv[1]
        print 'read config',key,value
        globals()[key] = value
Пример #2
0
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'mysite.wsgi.application'

# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

from utils import Properties
dbProperties = Properties("db.properties").getProperties()
DATABASES = {
    'default': {
        'ENGINE': dbProperties['mysql']['engine'],
        'NAME': dbProperties['mysql']['name'],
        'USER': dbProperties['mysql']['user'],
        'PASSWORD': dbProperties['mysql']['password'],
        'HOST': dbProperties['mysql']['host'],
        'PORT': dbProperties['mysql']['port'],
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/

LANGUAGE_CODE = 'en-us'