I have a development server running (and serving content) using the built in django server. All my templates that are rendered from generic views point correctly to the static media files (css/java/imgs) but ones that are rendered via custom views don't seem to prepend the /media/ folder to the urls. (At least this seems to be the problem)
In my settings I have:
DJANGO_PATH = os.path.realpath(os.path.dirname(__file__))
DB_PATH = os.path.join( (os.path.split(DJANGO_PATH))[0] , 'db/dev.db')
TEMPLATE_PATH = os.path.join( DJANGO_PATH , 'templates')
DEBUG = True
TEMPLATE_DEBUG = DEBUG
MEDIA_PATH = os.path.join( (os.path.split(DJANGO_PATH))[0] , 'media')
ADMIN_MEDIA_PREFIX = '/media/admin/'
MEDIA_URL = '/media/'
MEDIA_ROOT = MEDIA_PATH
and In my urls I have an entry
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True }),
Anyone got any ideas?
EDIT:
Ooops, forgot to mention. All my templates inherit from a base template which has all the media files like:
{{ MEDIA_URL }}css/some/file.css
So in my templates folder I have:
/templates/base.html
/templates/someapp/childtemplate.html
with all the css/js in the header like above. Then in the templates specific to my applicaiton I am simply inheriting the base template
Furthermore
I can view the media by visiting
localhost:8000/media/
no problem, so the urlCONF seems to be doing it's job