views:

56

answers:

3

I have my css file in /var/www/media/static/style.css and added

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

to my urls but when I go to http://localhost:8000/media/style.css I get: "Page not found: /media/style.css" what is wrong?

A: 

Have you updated your settings.MEDIA_ROOT (the filesystem path) and settings.MEDIA_URL (the URL for static assets) to reflect the setup of your project?

stevejalim
A: 

Check the logging output to see what's actually been requested - I've found that to be particularly helpful in diagnosing these issues.

heckj
A: 

The problem has to do with the actual choice of Path: '/media' was taken by admin I changed it to '/static' that works now.

niklasfi