Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(69)  |  Call(65)  |  Derive(0)  |  Import(4)
Parses a database URL.

        def parse(url, engine=None):
    """Parses a database URL."""

    if url == 'sqlite://:memory:':
        # this is a special case, because if we pass this URL into
        # urlparse, urlparse will choke trying to interpret "memory"
        # as a port number
        return {
            'ENGINE': SCHEMES['sqlite'],
            'NAME': ':memory:'
        }
        # note: no other settings are required for sqlite

    # otherwise parse the url as normal
    config = {}

    url = urlparse.urlparse(url)

    # Remove query strings.
    path = url.path[1:]
    path = path.split('?', 2)[0]

    # if we are using sqlite and we have no path, then assume we
    # want an in-memory database (this is the behaviour of sqlalchemy)
    if url.scheme == 'sqlite' and path == '':
        path = ':memory:'

    # Update with environment configuration.
    config.update({
        'NAME': path or '',
        'USER': url.username or '',
        'PASSWORD': url.password or '',
        'HOST': url.hostname or '',
        'PORT': url.port or '',
    })

    if engine:
        config['ENGINE'] = engine
    elif url.scheme in SCHEMES:
        config['ENGINE'] = SCHEMES[url.scheme]

    return config
        


src/d/j/dj-dynamic-forms-0.4.dev20140206215248/example/example/settings.py   dj-dynamic-forms(Download)
# Postgres FTW :)
DATABASES = {
    'default': dj_database_url.parse(os.environ.get('DATABASE_URL', 'postgres://localhost/dynamic_forms')),
}
 

src/d/j/dj-dynamic-forms-HEAD/example/example/settings.py   dj-dynamic-forms(Download)
# Postgres FTW :)
DATABASES = {
    'default': dj_database_url.parse(os.environ.get('DATABASE_URL', 'postgres://localhost/dynamic_forms')),
}
 

src/z/a/zamboni-HEAD/sites/stage/settings_base.py   zamboni(Download)
 
DATABASES = {}
DATABASES['default'] = dj_database_url.parse(private.DATABASES_DEFAULT_URL)
DATABASES['default']['ENGINE'] = 'mysql_pool'
DATABASES['default']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
DATABASES['slave'] = dj_database_url.parse(private.DATABASES_SLAVE_URL)
DATABASES['slave']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
SERVICES_DATABASE = dj_database_url.parse(private.SERVICES_DATABASE_URL)
 
DATABASE_POOL_ARGS = {

src/z/a/zamboni-HEAD/sites/prod/settings_base.py   zamboni(Download)
 
DATABASES = {}
DATABASES['default'] = dj_database_url.parse(private.DATABASES_DEFAULT_URL)
DATABASES['default']['ENGINE'] = 'mysql_pool'
DATABASES['default']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
DATABASES['slave'] = dj_database_url.parse(private.DATABASES_SLAVE_URL)
}
 
SERVICES_DATABASE = dj_database_url.parse(private.SERVICES_DATABASE_URL)
 
SLAVE_DATABASES = ['slave']

src/z/a/zamboni-HEAD/sites/paymentsalt/settings_base.py   zamboni(Download)
 
DATABASES = {}
DATABASES['default'] = dj_database_url.parse(private.DATABASES_DEFAULT_URL)
DATABASES['default']['ENGINE'] = 'mysql_pool'
DATABASES['default']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
DATABASES['slave'] = dj_database_url.parse(private.DATABASES_SLAVE_URL)
DATABASES['slave']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
SERVICES_DATABASE = dj_database_url.parse(private.SERVICES_DATABASE_URL)
 
DATABASE_POOL_ARGS = {

src/z/a/zamboni-HEAD/sites/landfill/settings_base.py   zamboni(Download)
 
DATABASES = {}
DATABASES['default'] = dj_database_url.parse(private.DATABASES_DEFAULT_URL)
DATABASES['default']['ENGINE'] = 'mysql_pool'
DATABASES['default']['sa_pool_key'] = 'master'
DATABASES['default']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
DATABASES['slave'] = dj_database_url.parse(private.DATABASES_SLAVE_URL)
DATABASES['slave']['sa_pool_key'] = 'slave'
 
SERVICES_DATABASE = dj_database_url.parse(private.SERVICES_DATABASE_URL)
 
DATABASE_POOL_ARGS = {

src/z/a/zamboni-HEAD/sites/identitystage/settings_base.py   zamboni(Download)
 
DATABASES = {}
DATABASES['default'] = dj_database_url.parse(private.DATABASES_DEFAULT_URL)
DATABASES['default']['ENGINE'] = 'mysql_pool'
DATABASES['default']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
DATABASES['slave'] = dj_database_url.parse(private.DATABASES_SLAVE_URL)
DATABASES['slave']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
SERVICES_DATABASE = dj_database_url.parse(private.SERVICES_DATABASE_URL)
 
DATABASE_POOL_ARGS = {

src/z/a/zamboni-HEAD/sites/dev/settings_base.py   zamboni(Download)
 
DATABASES = {}
DATABASES['default'] = dj_database_url.parse(private.DATABASES_DEFAULT_URL)
DATABASES['default']['ENGINE'] = 'mysql_pool'
DATABASES['default']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
DATABASES['slave'] = dj_database_url.parse(private.DATABASES_SLAVE_URL)
}
 
SERVICES_DATABASE = dj_database_url.parse(private.SERVICES_DATABASE_URL)
 
SLAVE_DATABASES = ['slave']

src/z/a/zamboni-HEAD/sites/altdev/settings_base.py   zamboni(Download)
 
DATABASES = {}
DATABASES['default'] = dj_database_url.parse(private.DATABASES_DEFAULT_URL)
DATABASES['default']['ENGINE'] = 'mysql_pool'
DATABASES['default']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
DATABASES['slave'] = dj_database_url.parse(private.DATABASES_SLAVE_URL)
}
 
SERVICES_DATABASE = dj_database_url.parse(private.SERVICES_DATABASE_URL)
 
SLAVE_DATABASES = ['slave']

src/w/e/webpay-HEAD/webpay/settings/sites/stage/settings_base.py   webpay(Download)
 
DATABASES = {}
DATABASES['default'] = dj_database_url.parse(private.DATABASES_DEFAULT_URL)
DATABASES['default']['ENGINE'] = 'django.db.backends.mysql'
DATABASES['default']['OPTIONS'] = {'init_command': 'SET storage_engine=InnoDB'}
 
 
DATABASES['slave'] = dj_database_url.parse(private.DATABASES_SLAVE_URL)

  1 | 2 | 3 | 4  Next