Hi, i set up static files for development purposes in following way:

urls.py:


if settings.DEBUG:
urlpatterns += patterns('',(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),)

settings.py:

MEDIA_ROOT = '/home/bagheera/NetBeansProjects/nml-src/storage'
MEDIA_URL = 'http://localhost:8000/site_media/'

index.html template:

<img alt="dupa"  src="{{ MEDIA_URL }}site_media/images/clock.gif"</img>

WHY i had to add "site_media" string, when it IS already included in MEDIA_URL ?
If i use
<img alt="dupa"  src="{{ MEDIA_URL }}images/clock.gif"</img>
dev server gives output:
/images/clock.gif/ HTTP/1.1" 404 2155

Full path to this file is:
'/home/bagheera/NetBeansProjects/nml-src/storage/images/clock.gif'
--
Linux user

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to