There are a number of things you need to do in order to get the static urls working on the development platform.
For this i would recommend looking through and reading this link. https://docs.djangoproject.com/en/dev/howto/static-files/
As well as this you also need to return a request context from your view.
Note that within your urls.py file you will also need to add the line.
urlpatterns += staticfiles_urlpatterns()
This line allows the URL's module within a development server to serve static files.
I also notice that you have a variable within your os.path.join
code. os.path.join
will already be pointing at you development directory if you are using a basic django setup.
You should be able to use:
# Additional locations of static files
STATICFILES_DIRS = (
os.path.join('static'),
)
Note: Also make sure your views are a returning a request context, as this is required for the STATIC_URL
variable to be populated. Likewise, ensure you have all the TEMPLATE_CONTEXT_PROCESSORS
added into the settings.py
file