The document root specified in urlpatterns should match the directory
where your files are located.  You have "/mysite/media/" in your
urlpatterns and "C:\django_projects\mysite\media" in your post.  Make
sure those match.


On Nov 18, 6:56 am, "Benjamin W." <b_w...@gmx.net> wrote:
> Hi there,
>
> I'm new to django and got my first little problem.
> I want to use a css file in my template. So I read 
> this:http://docs.djangoproject.com/en/dev/howto/static-files/
>
> I set up everything, but I don't get the file.
> My config:
>
> urls.py:
> urlpatterns = patterns('',
>         (r'^polls/', include('mysite.polls.urls')),
>         (r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
>         {'document_root': '/mysite/media/'}),
> )
>
> base.html (css include)
> <link rel="stylesheet" href="/site_media/css/design.css" type="text/
> css" media="screen"/>
>
> Path to media:
> C:\djanjo_projects\mysite\media
>
> When I open the source code of the page and click on the stylesheet, I
> get this information:
> Request URL:http://127.0.0.1:8080/site_media/css/design.css
> /mysite/media/css/design.css does not exist
>
> Whats wrong with my pass?
> Thanks a lot,
> greets Ben

--

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=.


Reply via email to