0

CSS link:

<link rel="stylesheet" href="/site_media/style.css"
        type="/text/css" /> 

I'm getting a -404 error while loading my CSS sheet.When I try to debug the location thru Firebug(Firefox), I get the below location.

"C:\Python27\Djangoprojects\django_bookmarks..\django_bookmarks\site_media\style.css" does not exist

Site_media is determined by the Python code in URLS.py

site_media = os.path.join(os.path.dirname(__file__), 'site_media')

Why do I get the ..\ in the location?

7
  • I'd suggest it is trying to C:\Python27\Djangoprojects\django_bookmarks\..\django_bookmarks\site_media\style.css the .. is a reference to the parent directory. Apr 4, 2012 at 3:19
  • Why do I get ..(two dots) after the django_bookmarks & django_bookmarks..again why do I see django_bookmarks twice?? Apr 4, 2012 at 3:22
  • there isn't enough information here to be able to tell you that. What is your urls.py file for your static media (assuming you are using the development server) Apr 4, 2012 at 3:32
  • 3
    I've just noticed that you seem to be saying that site_media is defined in the urls.py ... You need to define it in the settings.py file instead. Apr 4, 2012 at 3:58
  • Thanks James..The problem was with location of the site_media folder..It clicked once I read your comments..Thanks for it.. Apr 4, 2012 at 14:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.