Readed all these topic http://stackoverflow.com/search?q=django.views.static.serve And it not helped :(
OS: Windows XP Python: 2.7 Django: 1.2.3
Media in
D:\bugtracker\static
With files:
docicons-note.gif
style.css
In settings.py i set:
MEDIA_ROOT = 'D:/bugtracker/static/'
MEDIA_URL = '/static/'
In urls.py i set:
urlpatterns = patterns('',
(r'^media/(?P.*)$', 'django.views.static.serve',{'document_root':'settings.MEDIA_ROOT'}),
)
template: (read it without space in < tag>)
< !DOCTYPE html>
< html lang='ru'>
< head>
< link rel="stylesheet" type="text/css" href="media/style.css" />
< /head>
< body>
< img src="{{MEDIA_URL}}/docicons-note.gif"/>
< /body>
< /html>