title: static file issue causing django 500 error?
body: <p>I am using angular heroku and django. I have been noticing that when I use 'ng build' to build new static files to add to django then push to heroku, the heroku instance is showing a website that is several versions behind what my current code is. </p>
  
  <p>I attempted to run my django local server today after doing <code>ngbuild</code> placing my files in the designated folder,</p>
  
  <p>running <code>python manage.py collectstatic</code></p>
  
  <p>which it runs successfully. </p>
  
  <p>then I run my django server, navigate to my page and I get a 500 response. </p>
  
  <p>Because I am using angular, I have set up my django server as a rest backend. </p>
  
  <p>every endpoint the rest service uses starts with the url api/</p>
  
  <p>so localdomain/api/ &lt;-- restful service</p>
  
  <p>localdomain alone serves the angular app. </p>
  
  <p>I only receive the 500 sever error when I try and get the app served. </p>
  
  <p>Here are all my settings regarding static files: </p>
  
  <pre><code># Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'whitenoise.middleware.WhiteNoiseMiddleware',
  
  #angular distro root
  ANGULAR_APP_DIR = os.path.join(BASE_DIR, 'frontend/dist/')
  #image distro root
  ASSETS_DIR = os.path.join(BASE_DIR, 'frontend/dist/assets/')
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/1.11/howto/static-files/
  #STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
  STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
  STATIC_URL = '/static/'
  
  STATICFILES_DIRS = [
      os.path.join(ANGULAR_APP_DIR),
      os.path.join(ASSETS_DIR),
  
  ]
  </code></pre>
  
  <p>my template settings: </p>
  
  <pre><code>ROOT_URLCONF = 'suitsandtables.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': ['suitsandtables/templates',
                   'stemail/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',
              ],
          },
      },
  ]
  </code></pre>
  
  <p>my url to serve static files and my url to render the index.html page</p>
  
  <pre><code>url(r'^(?!/?static/)(?!/?media/)(?P&lt;path&gt;.*\..*)$',
          RedirectView.as_view(url='/static/%(path)s', permanent=False)),
   url(r'^$', views.RootView.as_view()),
  </code></pre>
  
  <p>my rootview class to render the index.html</p>
  
  <pre><code>class RootView(TemplateView):
      def get(self, request, **kwargs):
          return render(request, 'index.html', context = None)
  </code></pre>