I apologize if the error was posted earlier but I have not been able to work this through. I have the following django project structure.
.
├── db.sqlite3
├── manage.py
├── rango
│ ├── admin.py
│ ├── __init__.py
│ ├── migrations
│ │ ├── __init__.py
│ ├── models.py
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── static
│ ├── duck.jpg
│ └── images
│ └── duck.jpg
├── tango
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ ├── wsgi.py
└── templates
└── rango
└── index.html
My INSTALLED_APPS in settings.py and the STATIC FILE settings are as follows.
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rango',
)
and
STATIC_PATH = os.path.join(BASE_DIR,'static')
STATIC_URL = '/static/'
STATICFILES_DIR = (
STATIC_PATH,
)
<!DOCTYPE html>
{% load staticfiles %}
<html>
<head>
<title>Rango</title>
</head>
<body>
<h1> Rango says...</h1>
hello <strong>{{ boldmessage }}</strong><br/>
<img src="{% static "duck.jpg" %}" alt="Picture of Duck" /><br/>
<a href="/rango/about">About</a><br/>
</body>
</html>
# File: urls.py
from django.conf.urls import patterns, url
from rango import views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = patterns('',
url(r'^$',views.index,name='index'),
url(r'^about',views.about,name='about'),
)
urlpatterns += staticfiles_urlpatterns()
I am not sure why it does not work.
-- EDIT -- I am not sure what happened but this works after making the following changes which looks essentially the same to me though
STATIC_PATH = os.path.join(BASE_DIR,'static')
print os.path.join(BASE_DIR,'static')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
STATIC_PATH,
)
Thank you for your help!!