Is django.contrib.staticfiles
in your INSTALLED_APPS
in settings.py
?
Is DEBUG=False
? If so, you need to call runserver
with the –insecure
parameter:
python manage.py runserver --insecure
collectstatic
与通过开发服务器提供文件无关。它用于将静态文件收集到一个位置,STATIC_ROOT
以供Web服务器查找它们。实际上,collectstatic
将您的STATIC_ROOT
设置运行到某个路径STATICFILES_DIRS
是一个坏主意。您应该仔细检查以确保您的CSS文件现在甚至存在。