thanks for your help!
I just won't get it.
The
"GET /media_site/style.css HTTP/1.1" 404 2118
is triggered by the link-tag in the template.

After it checks in the urls.py. The output is the same, whether I have
the "static-stuff" configured or not. So I probabely can't tell
whether the url wasn't found other the problem occured later on.
Later it would try to find the file in the file system, in
$PROJECT_DIR/media_site/style.css

right?

On 15 Okt., 21:38, Jim McGaw <[email protected]> wrote:
> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to