title: Basic Django staticfile deployment on heroku
body: <p><a href="https://i.stack.imgur.com/E3aVL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E3aVL.png" alt="enter image description here"></a></p>
  
  <p>I'm trying to deploy a django project to heroku (previously on openshift), but cannot get the static files right. The project structure is above. In firebug I'm getting:</p>
  
  <pre><code>"NetworkError: 404 NOT FOUND - https://myproject.herokuapp.com/static/css/bootstrap.min.css"
  bootstrap.min.css
  "NetworkError: 404 NOT FOUND - https://myproject.herokuapp.com/static/css/landing-page.css"
  landing-page.css
  "NetworkError: 404 NOT FOUND - https://myproject.herokuapp.com/static/js/jquery.js"
  jquery.js
  "NetworkError: 404 NOT FOUND - https://myproject.herokuapp.com/static/js/jquery-validate.js"
  jquery-...date.js
  "NetworkError: 404 NOT FOUND - https://myproject.herokuapp.com/static/js/bootstrap.min.js"
  bootstrap.min.js
  "NetworkError: 404 NOT FOUND - https://myproject.herokuapp.com/static/js/val.js"
  val.js
  "NetworkError: 404 NOT FOUND - https://myproject.herokuapp.com/static/font-awesome-4.2.0/css/font-awesome.min.css"
  </code></pre>
  
  <p>The abridged settings.py file:</p>
  
  <pre><code>BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
  
  
  ....
  
  
  # Application definition
  
  INSTALLED_APPS = (
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'app1',
  )
  
  MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  )
  
  ROOT_URLCONF = 'mysite.urls'
  
  WSGI_APPLICATION = 'mysite.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
  
  ....
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.6/howto/static-files/
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.9/howto/static-files/
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.9/howto/static-files/
  
  
  STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
  STATIC_URL = '/static/'
  
  # Extra places for collectstatic to find static files.
  STATICFILES_DIRS = (
      os.path.join(BASE_DIR, 'static'),
      os.path.join(BASE_DIR, 'static/js'),
      os.path.join(BASE_DIR, 'static/css')
  )
  
  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.
      os.path.join(BASE_DIR, 'templates'),
  </code></pre>
  
  <p>mysite/wsgi.py:</p>
  
  <pre><code>import os
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
  
  from django.core.wsgi import get_wsgi_application
  application = get_wsgi_application()
  </code></pre>
  
  <p>What am I doing wrong?</p>