title: Heroku not found static files Django
body: <p>I know there are similar questions, but believe me I've gone through every each of them, but still not getting my static files going through. 
  Any help is greatly appreciated.   </p>
  
  <p>I have all my setting and other codes below.   </p>
  
  <p>The capture below shows when I run<br>
  <strong>$ heroku run python manage.py collectstatic</strong><br>
  and the erorr I get when I deploy my app.</p>
  
  <p><a href="https://i.stack.imgur.com/bnuVO.jpg" rel="nofollow noreferrer">Capture</a></p>
  
  <p>setting.py:</p>
  
  <pre><code>import os
  import dj_database_url
  
  # this is because I have my setting.py under setting folder
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  
  SECRET_KEY = os.environ['secret_key']
  
  DEBUG = False
  
  ADMINS = []
  ALLOWED_HOSTS = ['*']
  
  EMAIL_HOST = 'smtp.gmail.com'
  EMAIL_HOST_USER = '...@gmail.com'
  EMAIL_HOST_PASSWORD = os.environ['EMAIL_HOST_PASSWORD']
  EMAIL_PORT = 587
  EMAIL_USE_TLS = True
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.sites',
      'registration',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      # third party apps
      'crispy_forms',
      # my apps
      'home',
  ]
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      '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 = 'site2.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, 'templates')],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.template.context_processors.i18n',
                  'django.template.context_processors.media',
                  'django.template.context_processors.static',
                  'django.template.context_processors.tz',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'site2.wsgi.application'
  
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  db_from_env = dj_database_url.config()
  DATABASES['default'].update(db_from_env)
  
  AUTH_PASSWORD_VALIDATORS = [
      {
          'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
      },
  ]
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_L10N = True
  
  USE_TZ = True
  
  
  STATIC_URL = '/static/'
  STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  
  
  STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
  
  # registration settings
  ACCOUNT_ACTIVATION_DAYS = 7
  REGISTRATION_AUTO_LOGIN = True
  SITE_ID = 1
  LOGIN_REDIRECT_URL = '/'
  
  # crispy form settings
  CRISPY_TEMPLATE_PACK = 'bootstrap3'
  </code></pre>
  
  <p>Procfile:</p>
  
  <pre><code>web: gunicorn site2.wsgi --log-file -
  </code></pre>
  
  <p>wsgi.py:</p>
  
  <pre><code>import os
  
  from django.core.wsgi import get_wsgi_application
  from whitenoise.django import DjangoWhiteNoise
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "site2.settings")
  
  application = get_wsgi_application()
  application = DjangoWhiteNoise(application)
  </code></pre>
  
  <p>urls.py:</p>
  
  <pre><code>from django.conf.urls import url, include
  from django.contrib import admin
  from django.conf import settings
  from django.conf.urls.static import static
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^accounts/', include('registration.backends.default.urls')),
      url(r'^', include('home.urls')),
  ]
  
  if not settings.DEBUG:
      urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
  </code></pre>
  
  <p>Here is part of my template which is not loading properly:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  {% load static from staticfiles %}
  &lt;html lang="en"&gt;
    &lt;head&gt;
  
      &lt;!-- Custom styles for this template --&gt;
      &lt;link href="{% static 'css/offcanvas.css' %}" rel="stylesheet"&gt;
   &lt;/head&gt;
  </code></pre>