i am trying to learn django and my css file cant be linked with the html file idk why
This is the tree of the static folder:
├── images
├── js
├── plugins
└── styles
└── styles.css
settings.py
STATIC_URL = '/static/'
STATICFILES_DIR = [
os.path.join(BASE_DIR, 'static')
]
index.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Register</title>
{% load static %}
<link rel="stylesheet" href="{% static './styles/styles.css' %}">
</head>
<!-- <script src="../data/script-clac.js" type="text/javascript"></script> -->
<body class="body1">
<div class="div1">
<h2>Register</h2>
<p class="text">Name</p>
<input type="text" placeholder="Enter your name" id="name">
<p class="text">Username</p>
<input type="text" placeholder="Choose a username" id="username">
<p class="text">Password</p>
<input type="password" placeholder="Choose a password" id="password">
<p id="result"></p>
<input type="checkbox" onclick="myFunction()">Show Password
<button id="btn">Calculate</button>
</div>
</body>
</html>
Error message:
styles.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
I have been trying to fix the problem since a long time, please help me.
Also, here is my project directory