prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add whitenoise and serve static files from the app
  Add whitenoise to serve static files in the dev (and stage?) instances. 
  
  In production we'll probably go with another more efficient approach which is being investigated in #2949.
  
  Whitenoise activation should be configurable via the `ENABLE_WHITENOISE` env variable.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `wsgi/app.py`
  Content:
  ```
  1 """
  2 WSGI config for kitsune project.
  3 
  4 It exposes the WSGI callable as a module-level variable named ``application``.
  5 
  6 For more information on this file, see
  7 https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
  8 """
  9 import os
  10 os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kitsune.settings')  # NOQA
  11 
  12 from django.core.wsgi import get_wsgi_application
  13 
  14 import newrelic.agent
  15 from decouple import config
  16 from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
  17 
  18 # For django-celery
  19 os.environ['CELERY_LOADER'] = 'django'
  20 
  21 application = get_wsgi_application()
  22 application = Sentry(application)
  23 
  24 # Add NewRelic
  25 newrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini')
  26 newrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None)
  27 if newrelic_ini and newrelic_license_key:
  28     newrelic.agent.initialize(newrelic_ini)
  29     application = newrelic.agent.wsgi_application()(application)
  30
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/wsgi/app.py b/wsgi/app.py
  --- a/wsgi/app.py
  +++ b/wsgi/app.py
  @@ -21,6 +21,10 @@
   application = get_wsgi_application()
   application = Sentry(application)
   
  +if config('ENABLE_WHITENOISE', default=False, cast=bool):
  +    from whitenoise.django import DjangoWhiteNoise
  +    application = DjangoWhiteNoise(application)
  +
   # Add NewRelic
   newrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini')
   newrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None)
  
verification_info: {"golden_diff": "diff --git a/wsgi/app.py b/wsgi/app.py\n--- a/wsgi/app.py\n+++ b/wsgi/app.py\n@@ -21,6 +21,10 @@\n application = get_wsgi_application()\n application = Sentry(application)\n \n+if config('ENABLE_WHITENOISE', default=False, cast=bool):\n+    from whitenoise.django import DjangoWhiteNoise\n+    application = DjangoWhiteNoise(application)\n+\n # Add NewRelic\n newrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini')\n newrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None)\n", "issue": "Add whitenoise and serve static files from the app\nAdd whitenoise to serve static files in the dev (and stage?) instances. \r\n\r\nIn production we'll probably go with another more efficient approach which is being investigated in #2949.\r\n\r\nWhitenoise activation should be configurable via the `ENABLE_WHITENOISE` env variable.\n", "before_files": [{"content": "\"\"\"\nWSGI config for kitsune project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/\n\"\"\"\nimport os\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kitsune.settings')  # NOQA\n\nfrom django.core.wsgi import get_wsgi_application\n\nimport newrelic.agent\nfrom decouple import config\nfrom raven.contrib.django.raven_compat.middleware.wsgi import Sentry\n\n# For django-celery\nos.environ['CELERY_LOADER'] = 'django'\n\napplication = get_wsgi_application()\napplication = Sentry(application)\n\n# Add NewRelic\nnewrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini')\nnewrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None)\nif newrelic_ini and newrelic_license_key:\n    newrelic.agent.initialize(newrelic_ini)\n    application = newrelic.agent.wsgi_application()(application)\n", "path": "wsgi/app.py"}], "after_files": [{"content": "\"\"\"\nWSGI config for kitsune project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/\n\"\"\"\nimport os\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kitsune.settings')  # NOQA\n\nfrom django.core.wsgi import get_wsgi_application\n\nimport newrelic.agent\nfrom decouple import config\nfrom raven.contrib.django.raven_compat.middleware.wsgi import Sentry\n\n# For django-celery\nos.environ['CELERY_LOADER'] = 'django'\n\napplication = get_wsgi_application()\napplication = Sentry(application)\n\nif config('ENABLE_WHITENOISE', default=False, cast=bool):\n    from whitenoise.django import DjangoWhiteNoise\n    application = DjangoWhiteNoise(application)\n\n# Add NewRelic\nnewrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini')\nnewrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None)\nif newrelic_ini and newrelic_license_key:\n    newrelic.agent.initialize(newrelic_ini)\n    application = newrelic.agent.wsgi_application()(application)\n", "path": "wsgi/app.py"}]}