computed_settings: Set STATICFILES_DIRS to an existing absolute path.

Django has always expected this, but Django 4.0 added a system check
that spews warnings in production.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-08-26 13:20:47 -07:00 committed by Tim Abbott
parent 0612c29b02
commit 81d0f5bdd9
2 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,7 @@ from tools.lib import sanity_check
sanity_check.check_venv(__file__)
os.environ["DJANGO_SETTINGS_MODULE"] = "zproject.settings"
os.environ["ZULIP_COLLECTING_STATIC"] = "1"
from django.conf import settings
from scripts.lib.node_cache import setup_node_modules

View File

@ -607,7 +607,8 @@ LOCALE_PATHS = (os.path.join(DEPLOY_ROOT, "locale"),)
# We want all temporary uploaded files to be stored on disk.
FILE_UPLOAD_MAX_MEMORY_SIZE = 0
STATICFILES_DIRS = ["static/"]
if DEVELOPMENT or "ZULIP_COLLECTING_STATIC" in os.environ:
STATICFILES_DIRS = [os.path.join(DEPLOY_ROOT, "static")]
if DEBUG:
WEBPACK_BUNDLES = "../webpack/"