title: Heroku Django static files not found
body: <p>I am getting errors with a Django app on Heroku when referencing static files (e.g. CSS).
  The files are found when running the site on my local Linux machine, but not when it is deployed on Heroku.
  I have looked at the <a href="https://docs.djangoproject.com/en/3.0/howto/static-files/" rel="nofollow noreferrer">Django documentation</a>relating to static files, but I do not understand what I am doing wrong.</p>
  
  <p><code>django.contrib.staticfiles</code> is included in my <code>INSTALLED_APPS</code>.</p>
  
  <p>In <code>my_site/settings.py</code> I have <code>STATIC_URL = '/static/'</code>.</p>
  
  <p>In my HTML template I have</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>{% load static %}
  &lt;link rel="stylesheet" type="text/css" href="{% static 'reco/style.css' %}"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The result is that the CSS file is found when running locally, but not on Heroku.
  How can I fix this? I want the simplest possible solution - this is a very small site.</p>
  
  <pre><code># Log message when running the app on the local machine: file is found and has not changed (correct)
  [13/May/2020 15:02:52] "GET /static/reco/style.css HTTP/1.1" 304 0
  # Log message when running the app on Heroku: not found. Why?
  2020-05-13T20:09:20.327218+00:00 app[web.1]: Not Found: /static/reco/style.css
  </code></pre>
  
  <p>Update: Following suggestions from comments, I have configured the site as advised in the <a href="https://devcenter.heroku.com/articles/django-assets" rel="nofollow noreferrer">Heroku Django documentation</a></p>
  
  <pre><code>STATIC_ROOT = os.path.join(BASE_DIR, 'static')
  STATIC_URL = '/static/'    
  # Extra places for collectstatic to find static files.
  STATICFILES_DIRS = (
      os.path.join(BASE_DIR, 'reco', 'static'),
  )
  </code></pre>
  
  <p>Now when I deploy to Heroku I see that <code>collectstatic</code> is collecting my static files - but Heroku is stil not finding them at runtime.</p>