0

In main html document:

{% load static %}

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}sgbit/style.css" media="screen" >
    <title>sgbit</title>
</head>
<body>
    {% block content %}{% endblock %}
</body>
</html>

in settings.py file:

STATIC_URL = '/static/'

STATIC
    os.path.join(BASE_DIR , 'static'),
] 

I'm trying basic background color change to confirm css is working on my document, but nothing i try seems to work. I have watched a lot of youtube videos and also read the documents several times. can you please tell me the issues in my code.

Usama Abdulrehman
  • 1,041
  • 3
  • 11
  • 21
Cedric Dsouza
  • 27
  • 1
  • 4

1 Answers1

0

Use this:

{% load static %}

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" type="text/css" href="{% static 'sgbit/style.css'%} " media="screen" >
    <title>sgbit</title>
</head>
<body>
    {% block content %}{% endblock %}
</body>
</html>