aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/settings.py
diff options
context:
space:
mode:
authorGravatar kosayoda <[email protected]>2021-05-14 13:58:56 +0800
committerGravatar kosayoda <[email protected]>2021-05-14 14:23:29 +0800
commit274efc3ec73e2bcfee9cd93b26f737ee68fd4638 (patch)
treec74a0fb5cb80b605d21843b8bd424a192198dd8a /pydis_site/settings.py
parentMerge pull request #485 from python-discord/ks129/dewikification/redirection (diff)
Merge branch main into dewikification
Diffstat (limited to 'pydis_site/settings.py')
-rw-r--r--pydis_site/settings.py39
1 files changed, 12 insertions, 27 deletions
diff --git a/pydis_site/settings.py b/pydis_site/settings.py
index 65bd8e7a..2fd16241 100644
--- a/pydis_site/settings.py
+++ b/pydis_site/settings.py
@@ -23,14 +23,14 @@ from pydis_site.constants import GIT_SHA
env = environ.Env(
DEBUG=(bool, False),
- SITE_SENTRY_DSN=(str, "")
+ SITE_DSN=(str, "")
)
sentry_sdk.init(
- dsn=env('SITE_SENTRY_DSN'),
+ dsn=env('SITE_DSN'),
integrations=[DjangoIntegration()],
send_default_pii=True,
- release=f"pydis-site@{GIT_SHA}"
+ release=f"site@{GIT_SHA}"
)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
@@ -42,21 +42,7 @@ DEBUG = env('DEBUG')
# SECURITY WARNING: keep the secret key used in production secret!
if DEBUG:
- ALLOWED_HOSTS = env.list(
- 'ALLOWED_HOSTS',
- default=[
- 'pythondiscord.local',
- 'api.pythondiscord.local',
- 'admin.pythondiscord.local',
- 'staff.pythondiscord.local',
- '0.0.0.0', # noqa: S104
- 'localhost',
- 'web',
- 'api.web',
- 'admin.web',
- 'staff.web'
- ]
- )
+ ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', default=['*'])
SECRET_KEY = "yellow polkadot bikini" # noqa: S105
elif 'CI' in os.environ:
@@ -71,10 +57,7 @@ else:
'admin.pythondiscord.com',
'api.pythondiscord.com',
'staff.pythondiscord.com',
- 'pydis.com',
- 'api.pydis.com',
- 'admin.pydis.com',
- 'staff.pydis.com',
+ 'pydis-api.default.svc.cluster.local',
]
)
SECRET_KEY = env('SECRET_KEY')
@@ -147,7 +130,8 @@ WSGI_APPLICATION = 'pydis_site.wsgi.application'
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
DATABASES = {
- 'default': env.db()
+ 'default': env.db(),
+ 'metricity': env.db('METRICITY_DB_URL'),
}
# Password validation
@@ -232,14 +216,11 @@ LOGGING = {
'handlers': {
'console': {
'class': 'logging.StreamHandler'
- },
- 'database': {
- 'class': 'pydis_site.apps.api.dblogger.DatabaseLogHandler'
}
},
'loggers': {
'django': {
- 'handlers': ['console', 'database'],
+ 'handlers': ['console'],
'propagate': True,
'level': env(
'LOG_LEVEL',
@@ -279,6 +260,9 @@ BULMA_SETTINGS = {
"footer-padding": "1rem 1.5rem 1rem",
"tooltip-max-width": "30rem",
},
+ "extensions": [
+ "bulma-navbar-burger",
+ ],
}
# Information about site repository
@@ -292,4 +276,5 @@ EVENTS_PAGES_PATH = Path(BASE_DIR, "pydis_site", "templates", "events", "pages")
# Path for content pages
CONTENT_PAGES_PATH = Path(BASE_DIR, "pydis_site", "apps", "content", "resources")
+# Path for redirection links
REDIRECTIONS_PATH = Path(BASE_DIR, "pydis_site", "apps", "redirect", "redirects.yaml")