Exemplo n.º 1
0

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

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    }
}

db_from_env = dj_database_url.config()
if db_from_env:
    DATABASES['default'].update(db_from_env)
    DATABASES['default']['CONN_MAX_AGE'] = env_or('DJANGO_CONN_MAX_AGE', 5, int)

# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
Exemplo n.º 2
0
def patch_redis(g):
    REDIS_URL = env_or("REDIS_URL", None)
    if REDIS_URL:
        log_setting("REDIS_URL", REDIS_URL)
        g["REDIS_URL"] = REDIS_URL