【发布时间】:2023-03-04 14:57:01
【问题描述】:
所以我将我的网站上传到 digitalocean,当我进入管理页面时,CSS 没有显示
我访问了所有这些网站,但似乎没有任何效果
Pythonanywhere-DjangoStaticFiles
* -why my django admin site does not have the css style
我设置了我的 STATIC_ROOT 和 STATIC_URL,然后我运行了
python manage.py collectstatic
这是我的设置
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, '/home/django/django_project/django_project/static')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static/'),
]
【问题讨论】:
-
你是如何部署它的?你确定你的 nginx/apache 配置为提供静态文件了吗?
-
你说得对,我的配置文件有问题,谢谢@JonClements
标签: python django digital-ocean