roblemas com links para arquivos estáticos no Django 1

Estou executando o django 1.3, python 2.7 no Windows XP

Estou tentando configurar um css em uma pasta estática para o meu aplicativo djang

O modelo se parece com:

<html>
    <head>
        <title>css demo</title>
        <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/my.css" />

    </head>
    <body>

O HTML gerado se parece com:

<html> 
    <head> 
        <title>css demo</title> 
        <link rel="stylesheet" type="text/css" href="http://localhost/static/css/my.css" /> 

    </head>
...

Parece que eu tenho tudo configurado para especificar onde os arquivos estáticos estão no modelo e, em seguida, no html gerad

Mas há anotações em 'http: //localhost/static/css/my.cs '. Como faço para chegar lá?

Eu corri collectstatic assim:

C:\root\workspace\mywebapp\src\mywebapp>c:\Python27\python.exe manage.py collectstatic

You have requested to collect static files at the destination location as specified in your settings file.

This will overwrite existing files.
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes
Copying 'c:\root\workspace\mywebapp\src\mywebapp\css_demo\static\css\my.css'

1 static file copied to 'C:/root/workspace/mywebapp/src/mywebapp/static/'.

gora eu tenho o my.css em c: \ root \ espaço de trabalho \ mywebapp \ src \ mywebapp \ css_demo \ static \ css \ my.css

Nas minhas configurações, tenho:

STATIC_ROOT = 'C:/root/workspace/mywebapp/src/mywebapp/static/'
STATIC_URL = 'http://localhost/static/'

e no meu url.py eu tenho:

from django.conf.urls.defaults import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

urlpatterns = patterns('',

    (r'^mywebapp/', include('mywebapp.css_demo.urls')),
)

urlpatterns += staticfiles_urlpatterns()

Então, se eu entendi corretamente, meu css em:

c:\root\workspace\mywebapp\src\mywebapp\css_demo\static\css\my.css

não deve estar disponível em:

http://localhost/static/css/my.css

Mas, em vez disso, vejo:

Page not found (404)
Request Method: GET
Request URL:    http://localhost/static/css/my.css
Using the URLconf defined in mywebapp.urls, Django tried these URL patterns, in this order:
^mywebapp/
The current URL, static/css/my.css, didn't match any of these.

Eu também tentei:

http://localhost/mywebapp/static/css/my.css
http://localhost/mywebapp/css_demo/static/css/my.css

Estou perdendo um passo aqui? A documentação sobre isso é um pouco confusa.http: //docs.djangoproject.com/en/1.3/howto/static-files http: //docs.djangoproject.com/en/1.3/ref/contrib/staticfiles

Obrigado

questionAnswers(2)

yourAnswerToTheQuestion