Example #1
0
def monetdb_db_config(host, port, passphrase, console=True):
    """
    generates a Django DATABASE configuration dict containing all
    MonetDB databases.
    """
    databases = {}
    for monetdb in monetdb_list(host, port, passphrase):
        name = monetdb['name']
        databases[name] = {
            'ENGINE': 'djonet',
            'NAME': name,
            'USER': name,
            'PASSWORD': name,
            'HOST': host,
            'PORT': port,
        }
    return databases
Example #2
0
def monetdb_db_config(host, port, passphrase, console=True):
    """
    generates a Django DATABASE configuration dict containing all
    MonetDB databases.
    """
    databases = {}
    for monetdb in monetdb_list(host, port, passphrase):
        name = monetdb['name']
        databases[name] = {
            'ENGINE': 'djonet',
            'NAME': name,
            'USER': name,
            'PASSWORD': name,
            'HOST': host,
            'PORT': port,
            'CONSOLE': console,
        }
    return databases
Example #3
0
POSTGRES_PASSWORD = POSTGRES_USERNAME

for name, owner, size in postgres_list(POSTGRES_HOST, POSTGRES_USERNAME, POSTGRES_PASSWORD):
    # django reverse url mapping can't handle non aplhanum chars
    config_name = ("postgres_" + re.sub(r'\W+', '', name))
    DATABASES["postgres_" + name] = {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'HOST': POSTGRES_HOST,
        'NAME': name,
        'USER': name,
        'PASSWORD': name,
        'OWNER': owner,
        'SIZE': size,
    }

for monetdb in monetdb_list(MONETDB_HOST, MONETDB_PORT, MONETDB_PASSPHRASE):
    name = monetdb["name"]
    owner = monetdb["owner"]
    DATABASES[name] = {
        'ENGINE': 'djonet',
        'NAME': name,
        'USER': name,
        'PASSWORD': name,
        'HOST': MONETDB_HOST,
        'PORT': MONETDB_PORT,
        'OWNER': owner,
    }


# mongodb is used for image storage.
MONGODB = {