2021-02-27 20:07:48 +00:00
|
|
|
from pathlib import Path
|
|
|
|
from environs import Env
|
2018-06-23 11:00:26 +00:00
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
env = Env()
|
|
|
|
env.read_env()
|
2018-06-23 11:00:26 +00:00
|
|
|
|
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
2018-06-23 11:00:26 +00:00
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
SECRET_KEY = env.str("SECRET_KEY", default="something-very-secret")
|
2018-06-23 11:00:26 +00:00
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
DEBUG = env.bool("DEBUG", default=False)
|
2018-06-23 11:00:26 +00:00
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", default=["*"])
|
2018-06-23 11:00:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Application definition
|
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
2019-08-31 22:27:36 +00:00
|
|
|
"django.contrib.admin",
|
|
|
|
"django.contrib.auth",
|
|
|
|
"django.contrib.contenttypes",
|
|
|
|
"django.contrib.sessions",
|
|
|
|
"django.contrib.messages",
|
|
|
|
"django.contrib.staticfiles",
|
|
|
|
"django.contrib.sites",
|
2021-02-27 20:07:48 +00:00
|
|
|
"debug_toolbar",
|
|
|
|
"allauth",
|
|
|
|
"allauth.account",
|
2019-08-31 22:27:36 +00:00
|
|
|
"accounting",
|
|
|
|
"membership",
|
2018-06-23 11:00:26 +00:00
|
|
|
]
|
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
DATABASES = {"default": env.dj_db_url("DATABASE_URL")}
|
|
|
|
|
2018-06-23 11:00:26 +00:00
|
|
|
MIDDLEWARE = [
|
2019-08-31 22:27:36 +00:00
|
|
|
"django.middleware.security.SecurityMiddleware",
|
|
|
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
|
|
"django.middleware.common.CommonMiddleware",
|
|
|
|
"django.middleware.csrf.CsrfViewMiddleware",
|
|
|
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
|
|
"django.contrib.messages.middleware.MessageMiddleware",
|
|
|
|
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
2021-02-27 20:07:48 +00:00
|
|
|
"debug_toolbar.middleware.DebugToolbarMiddleware",
|
2018-06-23 11:00:26 +00:00
|
|
|
]
|
|
|
|
|
2019-08-31 22:27:36 +00:00
|
|
|
ROOT_URLCONF = "project.urls"
|
2018-06-23 11:00:26 +00:00
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
2019-08-31 22:27:36 +00:00
|
|
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
2021-02-27 20:07:48 +00:00
|
|
|
"DIRS": [BASE_DIR / "project" / "templates"],
|
2019-08-31 22:27:36 +00:00
|
|
|
"APP_DIRS": True,
|
|
|
|
"OPTIONS": {
|
|
|
|
"context_processors": [
|
|
|
|
"django.template.context_processors.debug",
|
|
|
|
"django.template.context_processors.request",
|
|
|
|
"django.contrib.auth.context_processors.auth",
|
|
|
|
"django.contrib.messages.context_processors.messages",
|
|
|
|
"project.context_processors.current_site",
|
|
|
|
]
|
2018-06-23 11:00:26 +00:00
|
|
|
},
|
2019-08-31 22:27:36 +00:00
|
|
|
}
|
2018-06-23 11:00:26 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
AUTHENTICATION_BACKENDS = (
|
2019-08-31 22:27:36 +00:00
|
|
|
"django.contrib.auth.backends.ModelBackend",
|
|
|
|
"allauth.account.auth_backends.AuthenticationBackend",
|
2018-06-23 11:00:26 +00:00
|
|
|
)
|
|
|
|
|
2019-08-31 22:27:36 +00:00
|
|
|
WSGI_APPLICATION = "project.wsgi.application"
|
2018-06-23 11:00:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
AUTH_PASSWORD_VALIDATORS = [
|
|
|
|
{
|
2019-08-31 22:27:36 +00:00
|
|
|
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator" # noqa
|
2018-06-23 11:00:26 +00:00
|
|
|
},
|
2019-08-31 22:27:36 +00:00
|
|
|
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"}, # noqa
|
|
|
|
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"}, # noqa
|
2018-06-23 11:00:26 +00:00
|
|
|
{
|
2019-08-31 22:27:36 +00:00
|
|
|
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator" # noqa
|
2018-06-23 11:00:26 +00:00
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
LANGUAGE_CODE = "da-dk"
|
2019-08-31 18:46:49 +00:00
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
TIME_ZONE = "Europe/Copenhagen"
|
2018-06-23 11:00:26 +00:00
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
2019-08-31 22:27:36 +00:00
|
|
|
STATIC_URL = "/static/"
|
2018-06-23 12:59:12 +00:00
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
STATICFILES_DIRS = [BASE_DIR / "project" / "static"]
|
2019-08-31 18:46:49 +00:00
|
|
|
|
2018-06-23 12:59:12 +00:00
|
|
|
SITE_ID = 1
|
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
LOGIN_REDIRECT_URL = "/"
|
|
|
|
|
2019-08-31 22:27:36 +00:00
|
|
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
2018-06-23 19:08:56 +00:00
|
|
|
|
2021-02-27 20:07:48 +00:00
|
|
|
# Always show DDT in development for any IP, not just 127.0.0.1 or
|
|
|
|
# settings.INTERNAL_IPS. This is useful in a docker setup where the
|
|
|
|
# requesting IP isn't static.
|
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
|
|
|
"SHOW_TOOLBAR_CALLBACK": lambda _x: DEBUG,
|
|
|
|
}
|
|
|
|
|
2019-08-31 22:27:36 +00:00
|
|
|
CURRENCIES = ("DKK",)
|
|
|
|
CURRENCY_CHOICES = [("DKK", "DKK")]
|