Reference style sheet in Django doesn't show full media path

johndo

New Member
I have looked everywhere and read the DJango tutorial to link a simple style sheet into my base.html file.With my settings.py file (Relevant parts)\[code\]MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'assets/')MEDIA_URL = '/assets/'\[/code\]And project root set at \[code\]PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))\[/code\]and i have defined in my urls.py file the media url pattern\[code\]if settings.DEBUG:urlpatterns += patterns('', (r'^assets/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),\[/code\]I have a folder structure that has the assets folder at the root level. I still get 404 errors when i link in my .html file as so.\[code\] <link rel= "stylesheet" href="http://stackoverflow.com/questions/14035457/{{ MEDIA_URL }}css/home.css"/>\[/code\]Edit: My template context processors\[code\]TEMPLATE_CONTEXT_PROCESSORS = ("django.core.context_processors.auth","django.core.context_processors.debug","django.core.context_processors.i18n","django.core.context_processors.media","myapp.processor.foos",)\[/code\]
 
Back
Top