Exemplo n.º 1
0
]

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
        'LOCATION': 'cache_order_restaurant_distance',
    }
}

WSGI_APPLICATION = 'star_burger.wsgi.application'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'

DATABASES = {
    'default': env.dj_db_url('DATABASE_URL', default='sqlite:////{0}'.format(os.path.join(BASE_DIR, 'db.sqlite3')))
}

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
Exemplo n.º 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 = 'config.wsgi.application'

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

DATABASES = {
    'default': env.dj_db_url("DATABASE_URL", default="sqlite:///db.sqlite3")
    # 'default': {
    #     'ENGINE': 'django.db.backends.sqlite3',
    #     'NAME': BASE_DIR / 'db.sqlite3',
    #     # 'ENGINE': 'django.db.backends.postgresql_psycopg2',
    #     # 'NAME': 'guest_lecture_db',
    #     # 'USER': '******',
    #     # 'PASSWORD': '******',
    #     # 'HOST': 'localhost',
    #     # 'PORT': 5432,
    # }
}

# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
Exemplo n.º 3
0
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'config.wsgi.application'

DATABASES = {
    "default":
    env.dj_db_url("DATABASE_URL",
                  default="sqlite:///" + os.path.join(BASE_DIR, "db.sqlite3"),
                  ssl_require=not DEBUG)
}

DATABASES = {
    'default': {
        'ENGINE':
        env.str("DATABASE_ENGINE", default='django.db.backends.postgresql'),
        'NAME':
        env.str('NAME', default='postgres'),
        'USER':
        env.str('USER', default='postgres'),
        'PASSWORD':
        env.str('PASSWORD', default='postgres'),
        'HOST':
        env.str('HOST', default='db'),
Exemplo n.º 4
0
LOGIN_REDIRECT_URL = '/'
LOGOUT_REDIRECT_URL = '/'

STATIC_ROOT = env.str('DINING_STATIC_ROOT',
                      default=os.path.join(BASE_DIR, 'static'))
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'assets/static')]
# STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

MEDIA_ROOT = env.str('DINING_MEDIA_ROOT',
                     default=os.path.join(BASE_DIR, 'uploads'))
MEDIA_URL = env.str('DINING_MEDIA_URL', default='/media/')

DATABASES = {
    'default': env.dj_db_url('DINING_DATABASE_URL',
                             default='sqlite:///db.sqlite3')
}
if not DATABASES['default'].get('PASSWORD'):
    DATABASES['default']['PASSWORD'] = env.file(
        'DINING_DATABASE_PASSWORD_FILE', default='')

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
Exemplo n.º 5
0
ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', ['localhost', '127.0.0.1'])
CSRF_TRUSTED_ORIGINS = ['http://' + h for h in ALLOWED_HOSTS
                        ] + ['https://' + h for h in ALLOWED_HOSTS]

# Configure SECRET KEY
SECRET_KEY = env('SECRET_KEY', 'I 4m tH3 d3f4u17 s3cr37')

# DATABASES SETTINGS

# If you have to deal with special characters in your password, use urlencode:
# https://django-environ.readthedocs.io/en/latest/#using-unsafe-characters-in-urls
DATABASES = {
    # reads var DATABASE_URL. If not set defaults to sqlite
    # To use mysql backend, you can set the following env for example
    # DATABASE_URL=mysql://fir:fir@fir_db:3306/fir
    'default': env.dj_db_url('DATABASE_URL',
                             default='sqlite:////tmp/fir.sqlite')
}

# SMTP SETTINGS
EMAIL_HOST = env('EMAIL_HOST', 'SMTP.DOMAIN.COM')
EMAIL_PORT = env.int('EMAIL_PORT', 25)

# Uncomment this line to set a different reply-to address when sending alerts
#REPLY_TO = env.str('REPLY_TO', 'to@domain')
EMAIL_FROM = env.str('EMAIL_FROM', '"NAME" <from@ndomain>')

# Uncomment these lines if you want additional CC or BCC for all sent emails
#EMAIL_CC = env.list('EMAIL_CC', ['cc@domain'])
#EMAIL_BCC = env.list('EMAIL_BCC', ['bcc@domain'])

# REDIS SETTINGS
Exemplo n.º 6
0
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'config.wsgi.application'

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

DATABASES = {
    "default":
    env.dj_db_url("DATABASE_URL", default="postgres://postgres@db/postgres")
}

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

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
Exemplo n.º 7
0
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'config.wsgi.application'

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

DATABASES = {'default': env.dj_db_url('DATABASE_URL')}

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

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME':
Exemplo n.º 8
0
        },
    },
]

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static"),
]

WSGI_APPLICATION = 'server.wsgi.application'

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

DATABASES = {
    'default':
    env.dj_db_url("SH_DATABASE_URL",
                  default="sqlite:///" + os.path.join(BASE_DIR, 'db.sqlite3'))
    # {
    #     'ENGINE': 'django.db.backends.sqlite3',
    #     'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    # }
}

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

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
Exemplo n.º 9
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
DATABASES = {
    'default':
    env.dj_db_url(
        'DATABASE_URL',
        'sqlite:///{}'.format(os.path.join(BASE_DIR, 'db.sqlite3')),
    ),
}

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

AUTH_PASSWORD_VALIDATORS = []

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

LANGUAGE_CODE = 'pt-BR'

TIME_ZONE = 'America/Sao_Paulo'
Exemplo n.º 10
0
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
            ],
        },
    },
]

WSGI_APPLICATION = 'django_project.wsgi.application'

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

DATABASES = {
    'default':
    env.dj_db_url('DATABASE_URL', f'sqlite:///{BASE_DIR / "db.sqlite3"}')
}

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

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
Exemplo n.º 11
0
    "django.middleware.common.CommonMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    "django.contrib.auth.middleware.AuthenticationMiddleware",
    "django.contrib.messages.middleware.MessageMiddleware",
    "django.middleware.clickjacking.XFrameOptionsMiddleware",
]

ROOT_URLCONF = "project.urls"


WSGI_APPLICATION = "project.wsgi.application"

# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
    "auth": env.dj_db_url("AUTH_DB_URL"),
    "default": {  # This is used only for session handling
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": BASE_DIR / "db.sqlite3",
    },
}

CACHES = {
    "default": {
        "BACKEND": "django_redis.cache.RedisCache",
        "LOCATION": env.str("REDIS_URL"),
    }
}


# Password validation
Exemplo n.º 12
0
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'kakadatabase.wsgi.application'

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

DATABASES = {
    'default':
    env.dj_db_url('DATABASE_URL',
                  default='postgres://postgres:@localhost:5432/kakadatabase'),
}

DATABASES['default']['CONN_MAX_AGE'] = 600
DATABASES['default']['ENGINE'] = 'django.contrib.gis.db.backends.postgis'

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

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

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
Exemplo n.º 13
0
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

# DATABASES
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#databases

DATABASES = {
    "default":
    env.dj_db_url("DATABASE_URL",
                  "postgres://*****:*****@localhost:5432/fake_django")
}

# PASSWORDS
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
Exemplo n.º 14
0
            "context_processors": [
                "django.template.context_processors.debug",
                "django.template.context_processors.request",
                "django.contrib.auth.context_processors.auth",
                "django.contrib.messages.context_processors.messages",
            ],
        },
    },
]

WSGI_APPLICATION = "actnow.wsgi.application"

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

DATABASES = {"default": env.dj_db_url("ACTNOW_DATABASE_URL")}

# Password hashing
# https://docs.djangoproject.com/en/3.2/ref/settings/#password-hashers

PASSWORD_HASHERS = [
    "django.contrib.auth.hashers.Argon2PasswordHasher",
    "django.contrib.auth.hashers.BCryptSHA256PasswordHasher",
    "django.contrib.auth.hashers.PBKDF2PasswordHasher",
    "django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher",
]

AUTHENTICATION_BACKENDS = [
    "django.contrib.auth.backends.ModelBackend",
    "accounts.backends.ActNowBackend",
]
Exemplo n.º 15
0
            "ENGINE": "django.db.backends.sqlite3",
            "NAME": os.fspath(TEST_DB_FILE),
        }
    }
else:
    DATABASES = {
        "default": (
            # The default SQLite timeout is 5 seconds, which can be too low and
            # give "Database is locked" errors when doing large backend updates
            # on a live system. Attempt to increase this.
            {
                "OPTIONS": {
                    "timeout": 30
                }
            }
            | env.dj_db_url("DATABASE_URL", default=defaultDatabasePath()))
    }

# Django sites framework

# See: https://docs.djangoproject.com/en/2.2/ref/contrib/sites/#enabling-the-sites-framework
SITE_ID = 1

# SecurityMiddleware

# Send X-Content-Type-Options: nosniff header
# (prevents browser from guessing content type and doing unwise things)
# See: https://owasp.org/www-project-secure-headers/#x-content-type-options
SECURE_CONTENT_TYPE_NOSNIFF = True

# Do not allow embedding within an <iframe> ANYWHERE
Exemplo n.º 16
0
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'where_to_go.wsgi.application'


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

DATABASES = {
    "default": env.dj_db_url(
        "DATABASE_URL", default="sqlite:///" + os.path.join(BASE_DIR, "db.sqlite3")
    )
}


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

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
Exemplo n.º 17
0
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'config.wsgi.application'

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

DATABASES = {
    'default':
    env.dj_db_url('DATABASE_URL', default='postgres://postgres@db/postgres')
}

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

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
Exemplo n.º 18
0
                "jobserver.context_processors.staff_nav",
                "jobserver.context_processors.nav",
                "jobserver.context_processors.disable_creating_jobs",
            ],
            "builtins": ["slippers.templatetags.slippers"],
        },
    },
]

WSGI_APPLICATION = "jobserver.wsgi.application"


# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {
    "default": env.dj_db_url("DATABASE_URL", default="postgres://localhost/jobserver")
}

# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"


# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
    {
        "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
    },
    {
        "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
Exemplo n.º 19
0
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'config.wsgi.application'

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

DATABASES = {'default': env.dj_db_url("DATABASE_URL")}

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

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME':
Exemplo n.º 20
0
                "django.template.context_processors.request",
                "django.contrib.auth.context_processors.auth",
                "django.contrib.messages.context_processors.messages",
                "jobserver.context_processors.backend_warnings",
                "jobserver.context_processors.nav",
            ],
        },
    },
]

WSGI_APPLICATION = "jobserver.wsgi.application"


# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
DATABASES = {"default": env.dj_db_url("DATABASE_URL", default="sqlite:///db.sqlite3")}

# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"


# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
    {
        "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
    },
    {
        "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
    },
Exemplo n.º 21
0
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'config.wsgi.application'

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

DATABASES = {"default": env.dj_db_url("DATABASE_URL")}

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

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME':
Exemplo n.º 22
0
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'backend.wsgi.application'

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

DATABASES = {
    'default':
    env.dj_db_url(
        'DATABASE_URL',
        'sqlite://localhost:5432/db.sqlite3',
    )
}

AUTH_USER_MODEL = 'users.User'

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

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME':