Sorry, David, didn't mean to hijack your discussion!

Looking over your original code, is it possible you need to use the +=
operator? So, you have your urlpatterns, and then you add one for the
static media below:

urlpatterns = pattern('',
    # patterns for site here
)

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

This depends on how you have thing set up...you look like you have:

patterns('', ... etc... ), which won't do anything. You need to add it
to the urlpatterns variable.

By the way, breaking it out into two urlpatterns definitions might
seem silly, but it also allows you to conditionalize the use of local
static media in DEBUG mode, so it won't be used in production:

urlpatterns = patterns('',
   # etc.
)

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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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