添加了扩展和加载静态标签后,Django崩溃了



所以我在django中使用了模板继承。在我使用

之后
{% extends 'basic.html' %}
{% load static %}

的HTML和CSS不更新。我的意思是,如果例如,当我改变页面标题,然后保存和刷新[同时按ctrl f5和ctrl r]它不做任何事情。扩展工作得很好,但当我首先使用load static时它不会加载它当我更新或添加任何html时它就像"我不在乎"不更新任何东西。代码

{% extends 'basic.html' %}
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Do</title>
</head>
<body>
<p> Help </p>    
</body>
</html>

basic.html

<div class="upper">
<p class="blogtitle"> Utsab's Blogs </p>
<a href="/" class="homebutton"> Home </a>
<a href="blogs" class="blogsbutton"> Blogs </a>
<a href="contact" class="contactbutton"> Contact </a>
</div>

<style>
.upper{
background-color: black;
height: 40px;
position: absolute;
top: 0%;
left: 0%;
right: 0%;
}
.blogtitle {
text-align: center;
}
.name {
text-align: center;
font-weight: bolder;
font-size: larger;
}
.text {
text-align: center;
font-size: large;
}
.homebutton {
font-family: 'Roboto', sans-serif;
position: absolute;
top: 10px;
left: 29%;
text-decoration: none;
color: azure;
}
.blogsbutton {
position: absolute;
left: 48%;
top: 10px;
font-family: 'Roboto', sans-serif;
color: azure;
text-decoration: none;
}
.contactbutton {
left: 68%;
position: absolute;
top: 10px;
font-family: 'Roboto', sans-serif;
color: azure;
text-decoration: none;
}
.homebutton:hover {
color: yellow;
}
.blogsbutton:hover {
color: yellow;
}
.contactbutton:hover {
color: yellow;
}
</style>

您应该包括basic.html而不是extends

{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Do</title>
</head>
<body>
{% include "basic.html" %}
<p> Help </p>    
</body>
</html>

请仔细阅读文档。