title: Why is Heroku running dev.py by force in Wagtail?
body: <p>I deployed my Wagtail app on Heroku and want the variable 'DEBUG' to be False on production. I wrote some code in an <strong>init</strong>.py file that tests an environment variable 'ENV' to decide which python file to execute. In production, it should execute only production.py, but it does not. The code actually seems to work because it is not printing my debug message in the case i'm in the development environement, but somehow, dev.py is executed after production.py</p>
  
  <p>I tried removing the variable 'DEBUG' from both files (production.py and dev.py) to put them in <strong>init</strong>.py and define its value according to the environment. It works, DEBUG becomes False in production but it seems like my static files aren't loaded anymore.</p>
  
  <pre class="lang-py prettyprint-override"><code>#__init__.py
  import os
  
  ENV = os.getenv('GLITCHYWARE_ENV', 'dev')
  
  if ENV == 'dev':
      print('DEV')
      from .dev import *
  elif ENV == 'prod':
      print('PROD')
      from .production import *
  </code></pre>
  
  <p>The log:</p>
  
  <pre><code>$ python manage.py collectstatic --noinput           
  PROD  
  The production.py code is executed
  The dev.py code is executed #1
  </code></pre>
  
  <p>As you can see, dev.py is executed after production.py, not six times though, i just put many print statements.</p>