title: Linking to CSS file in Django HTML template
body: <p>I am building a simple Django app, and my CSS is not showing up on the development server, even though it does work if I simply open the HTML file that links to it in my browser. I've investigated other related questions on SO, as well as the official tutorial on serving static files, but still can't figure out how to make my CSS work. </p>
  
  <p>I'm a novice, so please advise in simplest terms possible (but not simpler).</p>
  
  <p>Thanks!</p>
  
  <p>directory structure:</p>
  
  <pre><code>uber
    uber
    static
      css
        style.css
    templates
      home.html
  </code></pre>
  
  <p>settings.py:</p>
  
  <pre><code>MEDIA_ROOT = '/Users/pavelfage/Desktop/Hacking/django/uber/static/'
  
  # URL that handles the media served from MEDIA_ROOT. Make sure to use a
  # trailing slash.
  # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
  MEDIA_URL = '/static/'
  
  # Absolute path to the directory static files should be collected to.
  # Don't put anything in this directory yourself; store your static files
  # in apps' "static/" subdirectories and in STATICFILES_DIRS.
  # Example: "/home/media/media.lawrence.com/static/"
  STATIC_ROOT = ''
  
  # URL prefix for static files.
  # Example: "http://media.lawrence.com/static/"
  STATIC_URL = ''
  
  # Additional locations of static files
  STATICFILES_DIRS = (
      # Put strings here, like "/home/html/static" or "C:/www/django/static".
      # Always use forward slashes, even on Windows.
      # Don't forget to use absolute paths, not relative paths.
      #'/Users/pavelfage/Desktop/Hacking/django/uber/uberpoll/static',
  )
  
  # List of finder classes that know how to find static files in
  # various locations.
  STATICFILES_FINDERS = (
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
  )
  
  # Make this unique, and don't share it with anybody.
  SECRET_KEY = '(au)ipe++*c6e6r1s00z9d99qgsx!loqh*-!hcqys=6&amp;amp;bjk#*a'
  
  # List of callables that know how to import templates from various sources.
  TEMPLATE_LOADERS = (
      'django.template.loaders.filesystem.Loader',
      'django.template.loaders.app_directories.Loader',
  #     'django.template.loaders.eggs.Loader',
  )
  
  MIDDLEWARE_CLASSES = (
      'django.middleware.common.CommonMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      #'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      # Uncomment the next line for simple clickjacking protection:
      # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  )
  
  ROOT_URLCONF = 'uber.urls'
  
  # Python dotted path to the WSGI application used by Django's runserver.
  WSGI_APPLICATION = 'uber.wsgi.application'
  
  TEMPLATE_DIRS = (
      # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
      # Always use forward slashes, even on Windows.
      # Don't forget to use absolute paths, not relative paths.
      '/Users/pavelfage/Desktop/Hacking/django/uber/templates',
  )
  
  INSTALLED_APPS = (
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.sites',
      'django.contrib.messages',
      # 'django.contrib.staticfiles',
      # Uncomment the next line to enable the admin:
      # 'django.contrib.admin',
      # Uncomment the next line to enable admin documentation:
      # 'django.contrib.admindocs',
      'uberpoll'
  )
  </code></pre>
  
  <p>urls.py:</p>
  
  <pre><code>from django.conf.urls import patterns, include, url
  from uber import settings
  
  urlpatterns = patterns('',
      # Examples:
      url(r'^$', 'uberpoll.views.home'),
      # url(r'^uber/', include('uber.foo.urls')),
  
      # Uncomment the admin/doc line below to enable admin documentation:
      # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
  
      # Uncomment the next line to enable the admin:
      # url(r'^admin/', include(admin.site.urls)),
      url(r'^$', 'django.views.static.serve', {'document_root':settings.MEDIA_ROOT})
  )
  </code></pre>
  
  <p>HTML head with link:</p>
  
  <pre><code>&lt;head&gt;
          &lt;link rel='stylesheet' href='/static/css/style.css' type='text/css' media='screen'&gt;
  &lt;/head&gt;
  </code></pre>