diff options
author | 2022-08-13 01:53:19 +0200 | |
---|---|---|
committer | 2022-08-13 01:53:19 +0200 | |
commit | edcee093449fce833116ae3dbb15d6ccf3797652 (patch) | |
tree | 97037c6b40de103bc5939e02c4851d0676fa884d /pydis_site/settings.py | |
parent | Merge pull request #762 from python-discord/raise-static-builds (diff) |
Add Setting For Static Builds
Adds an explicit setting for static builds instead of relying on the
environment variable.
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/settings.py')
-rw-r--r-- | pydis_site/settings.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pydis_site/settings.py b/pydis_site/settings.py index bbf1d3aa..315ea737 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -95,11 +95,13 @@ else: ) SECRET_KEY = env('SECRET_KEY') +STATIC_BUILD: bool = env("STATIC_BUILD") + # Application definition NON_STATIC_APPS = [ 'pydis_site.apps.api', 'pydis_site.apps.staff', -] if not env("STATIC_BUILD") else [] +] if not STATIC_BUILD else [] INSTALLED_APPS = [ *NON_STATIC_APPS, @@ -130,7 +132,7 @@ if not env("BUILDING_DOCKER"): NON_STATIC_MIDDLEWARE = [ 'django_prometheus.middleware.PrometheusBeforeMiddleware', -] if not env("STATIC_BUILD") else [] +] if not STATIC_BUILD else [] # Ensure that Prometheus middlewares are first and last here. MIDDLEWARE = [ @@ -175,7 +177,7 @@ WSGI_APPLICATION = 'pydis_site.wsgi.application' DATABASES = { 'default': env.db(), 'metricity': env.db('METRICITY_DB_URL'), -} if not env("STATIC_BUILD") else {} +} if not STATIC_BUILD else {} # Password validation # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators |