Django template can't see CSS files

Posted by Technical Bard on Stack Overflow See other posts from Stack Overflow or by Technical Bard
Published on 2009-07-02T17:45:34Z Indexed on 2010/05/05 23:28 UTC
Read the original article Hit count: 245

Filed under:
|
|

I'm building a django app and I can't get the templates to see the CSS files... My settings.py file looks like:

MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'media')
MEDIA_URL = '/media/'

I've got the CSS files in /mysite/media/css/ and the template code contains:

<link rel="stylesheet" type="text/css" href="/media/css/site_base.css" />`

then, in the url.py file I have:

# DEVELOPMENT ONLY
(r'^media/(?P<path>.*)$', 'django.views.static.serve',
    {'document_root': '/media'}),

but the development server serves the plain html (without styles). What am I doing wrong?

© Stack Overflow or respective owner

Related posts about django

Related posts about django-templates