From 09d9673cb41e6db18464f704a0d551f7c5cb5785 Mon Sep 17 00:00:00 2001 From: xiaji Date: Mon, 5 Jan 2026 20:19:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9D=99=E6=80=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ diary_family/settings.py | 1 + 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 55b2082..412842c 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,9 @@ python manage.py migrate # 创建超级用户 python manage.py createsuperuser + +# 收集静态文件(重要!确保admin页面有CSS样式) +python manage.py collectstatic --noinput ``` ### 4. 配置Gunicorn diff --git a/diary_family/settings.py b/diary_family/settings.py index 77e5d05..0488f2e 100644 --- a/diary_family/settings.py +++ b/diary_family/settings.py @@ -169,3 +169,4 @@ TEMPLATES[0]['DIRS'] = [BASE_DIR / 'templates'] # Static files configuration STATICFILES_DIRS = [BASE_DIR / 'static'] +STATIC_ROOT = BASE_DIR / 'staticfiles'