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'