&quot“ get/static/css/stylesheet.css http/1.1” 404 1813

发布于 2025-02-10 17:54:03 字数 124 浏览 3 评论 0原文

我尝试通过使用“”

显示

错误来列在Django框架中的CSS文件。 sstatic.net/5e9kh.png“ rel =“ nofollow noreferrer”> file oder ”

I tried to ling CSS file in Django framework by using " "

It shows error

but, it is showing error ""GET /static/css/stylesheet.css HTTP/1.1" 404 1813file Oder"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

天生の放荡 2025-02-17 17:54:03

static_url in settings.py这样:

STATIC_URL = 'static/'

并且模板文件必须像这样

{% load static %}

<link rel="stylesheet" type="text/css" href="{% static 'app/css/style.css' %}">

define STATIC_URL in settings.py like that:

STATIC_URL = 'static/'

and template file must be like that

{% load static %}

<link rel="stylesheet" type="text/css" href="{% static 'app/css/style.css' %}">
鹤舞 2025-02-17 17:54:03

添加静态文件后,您是否使用以下命令?

python manage.py collectstatic

Did you use following command after adding static files?

python manage.py collectstatic
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文