-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsettings.py
81 lines (67 loc) · 2.04 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# -*- coding: utf-8 -*-
import os
from glob import glob
from django_extensions.management.commands.generate_secret_key import (
get_random_secret_key,
)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
SECRET_KEY = get_random_secret_key()
NODE_ENV = os.environ.get("NODE_ENV", "production")
DEBUG = bool(NODE_ENV == "development")
ALLOWED_HOSTS = ["*"]
INSTALLED_APPS = [
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.staticfiles",
"django_extensions",
"ddtrace.contrib.django",
"webpack_loader",
"mpcontribs.portal",
]
MIDDLEWARE = (
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"django.middleware.security.SecurityMiddleware",
"mpcontribs.portal.middleware.MyMiddleware",
)
ROOT_URLCONF = "mpcontribs.portal.urls"
path_glob = os.path.join(BASE_DIR, "mpcontribs", "users", "*", "explorer", "templates")
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": glob(path_glob),
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
"django.template.context_processors.debug",
"django.template.context_processors.request",
],
},
},
]
WSGI_APPLICATION = "wsgi.application"
PROCESS_NAME = os.environ.get("SUPERVISOR_PROCESS_NAME", "default")
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, f"{PROCESS_NAME}.sqlite3"),
}
}
LANGUAGE_CODE = "en-us"
TIME_ZONE = "UTC"
USE_I18N = True
USE_L10N = True
USE_TZ = True
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_DIRS = (os.path.join(BASE_DIR, "dist"),)
WEBPACK_LOADER = {
"DEFAULT": {
"CACHE": not DEBUG,
"BUNDLE_DIR_NAME": "./",
"STATS_FILE": os.path.join(BASE_DIR, "webpack-stats.json"),
}
}
APPEND_SLASH = False
SECURE_REFERRER_POLICY = "unsafe-url"