I may be making a simple mistake but after several days of troubleshooting and iterating I cannot locate the source of my problem. Despite my best efforts Django refuses to load my static css file but does load html and spits out exactly the same error each time. The error is Not Found: /"/static/index.css"
Here is my current code:
APP_NAME/APP_NAME/templates/index.html
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href=“{% static 'index.css' %}”>
APP_NAME/urls.py
from django.conf.urls import url
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
url(r'^APP_NAME/', include("APP_NAME.urls")),
url(r'^admin/', admin.site.urls),
] + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
APP_NAME/APP_NAME/urls.py
from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
url(r"^$", views.index, name = "index"),
] + static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
APP_NAME/APP_NAME/settings.py
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
ROOT_URLCONF = 'APP_NAME.urls'
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "APP_NAME/static/")
STATICFILES_DIR = [
os.path.join(BASE_DIR, "APP_NAME/static/")
]