title: Problems linking to static files in Django 1.3
body: <p>I'm running django 1.3, python 2.7 on windows XP</p>
  
  <p>I'm trying to setup a css in a static folder for my django app.</p>
  
  <p>The template looks like:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;css demo&lt;/title&gt;
          &lt;link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/my.css" /&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
  </code></pre>
  
  <p>The generated HTML looks like:</p>
  
  <pre><code>&lt;html&gt; 
      &lt;head&gt; 
          &lt;title&gt;css demo&lt;/title&gt; 
          &lt;link rel="stylesheet" type="text/css" href="http://localhost/static/css/my.css" /&gt; 
  
      &lt;/head&gt;
  ...
  </code></pre>
  
  <p>So it appears that I have everything set up in order to specify where the static files are in the template, and then in the generated html.</p>
  
  <p>But there is noting at '<a href="http://localhost/static/css/my.css" rel="noreferrer">http://localhost/static/css/my.css</a>'. How do I get it there?</p>
  
  <p>I ran collectstatic like so:</p>
  
  <pre><code>C:\root\workspace\mywebapp\src\mywebapp&gt;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/'.
  </code></pre>
  
  <p>So I now have my.css in c:\root\workspace\mywebapp\src\mywebapp\css_demo\static\css\my.css</p>
  
  <p>In my settings, I have:</p>
  
  <pre><code>STATIC_ROOT = 'C:/root/workspace/mywebapp/src/mywebapp/static/'
  STATIC_URL = 'http://localhost/static/'
  </code></pre>
  
  <p>and in my url.py I have:</p>
  
  <pre><code>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()
  </code></pre>
  
  <p>So if I understand correctly, my css at: </p>
  
  <pre><code>c:\root\workspace\mywebapp\src\mywebapp\css_demo\static\css\my.css
  </code></pre>
  
  <p>should no be available at: </p>
  
  <pre><code>http://localhost/static/css/my.css
  </code></pre>
  
  <p>But instead I see:</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>http://localhost/mywebapp/static/css/my.css
  http://localhost/mywebapp/css_demo/static/css/my.css
  </code></pre>
  
  <p>Am I missing a step here?
  The documentation on this is a bit confusing.
  <a href="http://docs.djangoproject.com/en/1.3/howto/static-files/" rel="noreferrer">http://docs.djangoproject.com/en/1.3/howto/static-files/</a>
  <a href="http://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/" rel="noreferrer">http://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/</a></p>
  
  <p>Thanks!</p>