I am creating a website with Django and for some reason my CSS file is having no effect on the page. I have checked to make sure my STATIC_URL is defined but still no luck.
My settings.py:
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
Inside of my blog app I have a static directory
blog
|
static
|
css
|
blog.css
My HTML doc:
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Medicare Supplemental info</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<!-- This is where I'm loading the CSS file -->
<link rel="stylesheet" href="{% static 'css/blog.css' %}">
</head>
I checked to make sure that I have the required app installed in the settings.py:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog',
]
I have also tried changing the way I load static files from:
{% load staticfiles %}
to:
{% load static %}
Still no luck. What is it I'm doing wrong?
