I had the same problem and none of the answers I found worked.
It turns out that there are a few parts that must be set up correctly for static files to work.
Note: I'm using django 1.6 and this solution is for development not deployment.
Setting up static file dirs
django-admin.py startproject $site_name
mkdir $site_name/static
mkdir $site_name/static/css
mkdir $site_name/static/javascript
mkdir $site_name/static/images
your folder should look like this
$site_name/
manage.py
$site_name/
__init__.py
settings.py
urls.py
wsgi.py
static/
css/
javascript
images/
edit the $site_name/$site_name/setting.py file and add
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS =( os.path.join(STATIC_ROOT, 'css/'),
os.path.join(STATIC_ROOT, 'javascript/'),
os.path.join(STATIC_ROOT, 'images/')
)
edit $site_name/$site_name/urls.py and add
from django.conf import settings
from django.conf.urls.static import static
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
using static urls
{% load staticfiles %}
<a href="{% static "banner.png" %}">
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…