From 74c269b862d74b6ad819abd517debbf93aecd5ae Mon Sep 17 00:00:00 2001 From: Xie Yanbo Date: Fri, 3 Nov 2023 14:58:45 +0800 Subject: [PATCH] feat: specify the static url prefix (#88) --- README.md | 2 ++ baidupcsleecher/settings.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 64f5898..2d744f1 100644 --- a/README.md +++ b/README.md @@ -218,4 +218,6 @@ DB_USER = 'postgres' DB_PASSWORD = '' DB_HOST = '' DB_PORT = '' +# prefix of url to access static files +DJANGO_STATIC_URL = 'static/' ``` diff --git a/baidupcsleecher/settings.py b/baidupcsleecher/settings.py index f121bf2..b4eca1f 100644 --- a/baidupcsleecher/settings.py +++ b/baidupcsleecher/settings.py @@ -188,7 +188,7 @@ # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.1/howto/static-files/ -STATIC_URL = "static/" +STATIC_URL = getenv("DJANGO_STATIC_URL", "static/") STATIC_ROOT = BASE_DIR / "staticfiles" STATICFILES_DIRS = [ BASE_DIR / "static",