I’m trying to figure out why I can’t override base.css in Django.
In settings.py I have:
STATIC_URL = "/site_media/static/"
And in site_base.html:
<link rel="stylesheet" href="{{ STATIC_URL }}pinax/css/base.css" />
And I have customized the file located in /site_media/static/pinax/css/base.css. But instead of reading the file from here, it is reading it from my python/site-packages/pinax directory still. And in the same site_base.html file I am able to override an image which is in the /site_media_static/pinax/images/ folder, which seems odd that I can overwrite the image but not the CSS file.
Any idea what I’m doing wrong?
The
STATIC_URLis the URL static files are served from, not the directory where they are stored.You need to add the directory containing your static files to
STATICFILES_DIRSor put your static files in an app’sstaticsubdir.See the docs for the Django staticfiles app.