I know this is a stupid question, but I've read through the Django documentation a dozen times and read every related question on on here and still can't figure out what I'm doing wrong.
I'm trying to link my template CSS to a file in my static root. Can someone tell me what I'm doing wrong?
settings.py:
STATIC_URL = '/static/'
STATIC_ROOT = 'C:/Users/Chris/Dropbox/MyProject/MyProject/static/styles/'
STATICFILES_DIRS = (
"C:/Users/Chris/Dropbox/MyProject/MyProject/static/styles",
)
in the template:
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static '/styles/style.css' %}">
urls.py
from django.conf.urls.static import static
urlpatterns = patterns('',
# my url patterns here
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
My guess is that either the static files code in urls.py is incorrect or the STATICFILES_DIRS in settings.py, but I've tried a million combinations based on other questions on stackoverflow and nothing seems to work. I just get a 404 page not found error.
Any help is appreciated. I've spent an embarrassing amount of time on this.