STATIC_ROOT = env.str("STATIC_ROOT")

# Rest framework

REST_FRAMEWORK = {
    "DEFAULT_AUTHENTICATION_CLASSES": [
        "apps.oidc.auth.InuitsOIDCAuthentication",
    ],
    "DEFAULT_PERMISSION_CLASSES": [
        "rest_framework.permissions.IsAuthenticated",
    ],
    "DEFAULT_PAGINATION_CLASS": "scouts_wwdb_api.pagination.ScoutsPageNumberPagination",
}

# Email
email = env.dj_email_url("EMAIL_URL")
EMAIL_HOST = email["EMAIL_HOST"]
EMAIL_PORT = email["EMAIL_PORT"]
EMAIL_HOST_PASSWORD = email["EMAIL_HOST_PASSWORD"]
EMAIL_HOST_USER = email["EMAIL_HOST_USER"]
EMAIL_USE_TLS = email["EMAIL_USE_TLS"]

DEFAULT_FROM_EMAIL = env.str("EMAIL_SENDER")
DEFAULT_EMAIL_RECIPIENTS = env.list("EMAIL_RECIPIENTS")


# CORS
CORS_ORIGIN_WHITELIST = env.list("CORS_ORIGIN_WHITELIST")

# OIDC
AUTH_USER_MODEL = "scouts_auth.User"
예제 #2
0
    },
    {
        "NAME": "user.password_validation.CharacterClassValidator",
    },
    {
        "NAME": "user.password_validation.OldPasswordValidator",
        "OPTIONS": {
            "count": 5,
        },
    },
]

# Email
email_config = env.dj_email_url(
    "EMAIL_URL",
    default=
    "console://*****:*****@localhost?_server_email=root@localhost&_default_from_email=root@localhost",
)
EMAIL_FILE_PATH = email_config["EMAIL_FILE_PATH"]
EMAIL_HOST_USER = email_config["EMAIL_HOST_USER"]
EMAIL_HOST_PASSWORD = email_config["EMAIL_HOST_PASSWORD"]
EMAIL_HOST = email_config["EMAIL_HOST"]
EMAIL_PORT = email_config["EMAIL_PORT"]
EMAIL_BACKEND = email_config["EMAIL_BACKEND"]
EMAIL_USE_TLS = email_config["EMAIL_USE_TLS"]
EMAIL_USE_SSL = email_config["EMAIL_USE_SSL"]
if "SERVER_EMAIL" in email_config:
    SERVER_EMAIL = email_config["SERVER_EMAIL"]
if "DEFAULT_FROM_EMAIL" in email_config:
    DEFAULT_FROM_EMAIL = email_config["DEFAULT_FROM_EMAIL"]
예제 #3
0

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

LANGUAGE_CODE = 'ru-ru'

TIME_ZONE = env.str("TIME_ZONE", default='Europe/Moscow')

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = env.str('STATIC_ROOT', '/var/www/django-primetver/static/')


# Email settings
email = env.dj_email_url("EMAIL_URL", default="smtp://")
EMAIL_HOST = email["EMAIL_HOST"]
EMAIL_PORT = email["EMAIL_PORT"]
EMAIL_HOST_PASSWORD = email["EMAIL_HOST_PASSWORD"]
EMAIL_HOST_USER = email["EMAIL_HOST_USER"]
EMAIL_USE_TLS = email["EMAIL_USE_TLS"]
예제 #4
0
# How many days is Family data considered valid.
# After this period an E-mail asking for information
# Checkup is sent to the Family.
REQUEST_FAMILY_VALIDATION_PERIOD = 180

STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
ADMIN_MEDIA_PREFIX = "/static/admin/"
STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
ADMINS = eval(os.environ["ADMINS"])
MANAGERS = ADMINS


SITE_CONTACT = "Coding Pirates <*****@*****.**>"
EMAIL_SUBJECT_PREFIX = "[Coding Pirates Medlemsdatabase] "
email = env.dj_email_url("EMAIL_URL")
EMAIL_BACKEND = email["EMAIL_BACKEND"]
EMAIL_HOST = email["EMAIL_HOST"]
EMAIL_HOST_USER = email["EMAIL_HOST_USER"]
EMAIL_HOST_PASSWORD = email["EMAIL_HOST_PASSWORD"]
EMAIL_FILE_PATH = BASE_DIR
SERVER_EMAIL = "*****@*****.**"
EMAIL_PORT = email["EMAIL_PORT"]
EMAIL_USE_SSL = email["EMAIL_USE_SSL"]
DEFAULT_FROM_EMAIL = "*****@*****.**"
EMAIL_TIMEOUT = 30

EMAIL_USE_TLS = True
EMAIL_USE_SSL = False

AUTHENTICATION_BACKENDS = ("members.backends.CaseInsensitiveModelBackend",)
예제 #5
0
SHORT_DATETIME_FORMAT = 'd-m-Y G:i'  # Default: m/d/Y P

USE_I18N = False
USE_L10N = False
USE_TZ = True
USE_THOUSAND_SEPARATOR = True

AUTHENTICATION_BACKENDS = [
    'django.contrib.auth.backends.ModelBackend',
    'allauth.account.auth_backends.AuthenticationBackend',
]

SITE_ID = 1

# See https://github.com/migonzalvar/dj-email-url
email_config = env.dj_email_url('DINING_EMAIL_URL', default='console:')
EMAIL_HOST = email_config['EMAIL_HOST']
EMAIL_PORT = email_config['EMAIL_PORT']
EMAIL_HOST_USER = email_config['EMAIL_HOST_USER']
EMAIL_HOST_PASSWORD = email_config['EMAIL_HOST_PASSWORD'] or env.file(
    'DINING_EMAIL_PASSWORD_FILE', default='')
EMAIL_BACKEND = email_config['EMAIL_BACKEND']
EMAIL_USE_TLS = email_config['EMAIL_USE_TLS']
EMAIL_USE_SSL = email_config['EMAIL_USE_SSL']

DEFAULT_FROM_EMAIL = env.str('DINING_DEFAULT_FROM_EMAIL',
                             default='webmaster@localhost')
SERVER_EMAIL = env.str('DINING_SERVER_EMAIL', default='root@localhost')
ADMINS = getaddresses(env.list('DINING_ADMINS', default=''))

# Allauth configuration