settings.py
First the media path must be defined and must differentiate it self:
MEDIA_ROOT = '/path/to/media/'
MEDIA_URL = ''
ADMIN_MEDIA_PREFIX = '/amedia/'
urls.py
Now we add/link the path to the media path itself:
if settings.DEBUG:
urlpatterns += patterns('', (r'^media/(?P
In the given HTML file header (index.html is just an example file), the style sheet link must be added:
<link href="/media/css/bluebusiness.css" rel="stylesheet" type="text/css" />
It is assumed that the media path is as follows:
/media/
/media/css/
/media/images/
Thus when calling other style sheets and/or images, these must follow the proper call path.
2 comments:
Thanks a lot!
In the lines
urlpatterns += patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root':'/home/fbenavides/Documents/workspace3dot3/txm/src/txm/media/', 'show_indexes': True}), )
The <path> is not escaped so disappears..
Post a Comment