title: STATIC_ROOT setting in Django
body: <p>I am learning Django and have built a sample Django app. It works fine on my computer, but I am having trouble deploying it to Heroku. 
  My root directory has the following structure:
  <a href="https://i.stack.imgur.com/RGouc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RGouc.jpg" alt="First screen"></a></p>
  
  <p><a href="https://i.stack.imgur.com/uoQpU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uoQpU.jpg" alt="Second screen"></a></p>
  
  <p>My setttings.py file has the following settings for static files:</p>
  
  <pre><code>STATIC_URL = '/static/'
  STATICFILES_DIRS = [
  os.path.join(BASE_DIR, "static")
  ]
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
  </code></pre>
  
  <p>The full settings.py file is following:</p>
  
  <pre><code>    """
  Django settings for firstdjango project.
  
  Generated by 'django-admin startproject' using Django 1.8.
  
  For more information on this file, see
  https://docs.djangoproject.com/en/1.8/topics/settings/
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/1.8/ref/settings/
  """
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  import os
  
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = 'j8s(6fw61+cx_o=g!9a(vs!wbj0&amp;f!7u_lw$(eap5d4li@!b4('
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = []
  
  
  # Application definition
  
  INSTALLED_APPS = (
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'inventory',
  )
  
  MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
      'django.middleware.security.SecurityMiddleware',
  )
  
  ROOT_URLCONF = 'firstdjango.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': ['firstdjango/templates'],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'firstdjango.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/1.8/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.8/howto/static-files/
  
  import dj_database_url
  db_from_env = dj_database_url.config(conn_max_age = 500)
  DATABASES['default'].update(db_from_env)
  
  # STATIC_URL = '/static/'
  # STATICFILES_DIRS = [
  #    os.path.join(BASE_DIR, "static")
  # ]
  # STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  STATIC_URL = '/static/'    
  
  # Extra places for collectstatic to find static files.
  STATICFILES_DIRS = [
      os.path.join(BASE_DIR, 'static'),
  ]
  STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
  </code></pre>
  
  <p>When I try to deploy to Heroku, I get the following error message:</p>
  
  <p>ImproperlyConfigured:You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path</p>