prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Inconvenience of client cache update upon releasing/deploy new versions
  ## Description of the issue
  
  When deploying a new version of an application, users are inconvenienced as they need to manually refresh the client cache to see the latest changes.
  
  ## Ideas of solution
  
  ChatGPT suggested to introduce a Cache Busting Mechanism. We could use this existing lib [django-compressor](https://github.com/django-compressor/django-compressor).
  
  > To set up a cache-busting mechanism in your Django application, you can use the Django extension module "django-compressor". Django Compressor allows you to compress static resources such as CSS and JavaScript files and assign them a unique hash value based on their content. This automatically changes the URL of the resources whenever they are modified.
  
  ## Workflow checklist
  - [x] I am aware of the workflow in [CONTRIBUTING.md](https://github.com/OpenEnergyPlatform/oeplatform/blob/develop/CONTRIBUTING.md)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `oeplatform/settings.py`
  Content:
  ```
  1 """
  2 Django settings for oeplatform project.
  3 
  4 Generated by 'django-admin startproject' using Django 1.8.5.
  5 
  6 For more information on this file, see
  7 https://docs.djangoproject.com/en/1.8/topics/settings/
  8 
  9 For the full list of settings and their values, see
  10 https://docs.djangoproject.com/en/1.8/ref/settings/
  11 """
  12 
  13 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  14 
  15 try:
  16     from .securitysettings import *  # noqa
  17 except ImportError:
  18     import logging
  19     import os
  20 
  21     logging.error("No securitysettings found. Triggerd in oeplatform/settings.py")
  22     SECRET_KEY = os.environ.get("SECRET_KEY", "0")
  23     DEFAULT_FROM_EMAIL = os.environ.get("DEFAULT_FROM_EMAIL")
  24     URL = os.environ.get("URL")
  25 
  26 # Quick-start development settings - unsuitable for production
  27 # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
  28 
  29 # Application definition
  30 
  31 INSTALLED_APPS = (
  32     "django.contrib.sites",
  33     "django.contrib.admin",
  34     "django.contrib.auth",
  35     "django.contrib.contenttypes",
  36     "django.contrib.sessions",
  37     "django.contrib.messages",
  38     "django.contrib.staticfiles",
  39     "django.contrib.sessions.backends.signed_cookies",
  40     "django_bootstrap5",
  41     "rest_framework",
  42     "rest_framework.authtoken",
  43     "modelview",
  44     "modelview.templatetags.modelview_extras",
  45     "login",
  46     "base",
  47     "base.templatetags.base_tags",
  48     "widget_tweaks",
  49     "dataedit",
  50     "colorfield",
  51     "api",
  52     "ontology",
  53     "axes",
  54     "captcha",
  55     "django.contrib.postgres",
  56     "fontawesome_5",
  57     "django_better_admin_arrayfield",
  58     "oeo_viewer",
  59 )
  60 
  61 MIDDLEWARE = (
  62     "django.contrib.sites.middleware.CurrentSiteMiddleware",
  63     "django.contrib.sessions.middleware.SessionMiddleware",
  64     "django.middleware.common.CommonMiddleware",
  65     "django.middleware.csrf.CsrfViewMiddleware",
  66     "django.contrib.auth.middleware.AuthenticationMiddleware",
  67     "django.contrib.messages.middleware.MessageMiddleware",
  68     "django.middleware.clickjacking.XFrameOptionsMiddleware",
  69     "django.middleware.security.SecurityMiddleware",
  70     "login.middleware.DetachMiddleware",
  71     "axes.middleware.AxesMiddleware",
  72     "django.middleware.common.CommonMiddleware",
  73 )
  74 
  75 ROOT_URLCONF = "oeplatform.urls"
  76 
  77 EXTERNAL_URLS = {
  78     "tutorials_index": "https://openenergyplatform.github.io/academy/",
  79     "tutorials_faq": "https://openenergyplatform.github.io/academy/",
  80     "tutorials_api1": "https://openenergyplatform.github.io/academy/tutorials/api/OEP_API_tutorial_part1/",  # noqa E501
  81     "tutorials_licenses": "https://openenergyplatform.github.io/academy/tutorials/metadata/tutorial_open-data-licenses/",
  82     # noqa E501
  83     "readthedocs": "https://oeplatform.readthedocs.io/en/latest/?badge=latest",
  84     "compendium": "https://openenergyplatform.github.io/organisation/",
  85 }
  86 
  87 
  88 def external_urls_context_processor(request):
  89     """Define hard coded external urls here.
  90     Use in templates like this: {{ EXTERNAL_URLS.<name_of_url> }}
  91     Also, you may want to add an icon indicating external links, e.g.
  92     """
  93     return {"EXTERNAL_URLS": EXTERNAL_URLS}
  94 
  95 
  96 SITE_ID = 1
  97 
  98 TEMPLATES = [
  99     {
  100         "BACKEND": "django.template.backends.django.DjangoTemplates",
  101         "DIRS": [],
  102         "APP_DIRS": True,
  103         "OPTIONS": {
  104             "context_processors": [
  105                 "django.template.context_processors.debug",
  106                 "django.template.context_processors.request",
  107                 "django.contrib.auth.context_processors.auth",
  108                 "django.contrib.messages.context_processors.messages",
  109                 "oeplatform.settings.external_urls_context_processor",
  110             ]
  111         },
  112     }
  113 ]
  114 
  115 CORS_ORIGIN_WHITELIST = ["http://localhost:3000", "http://127.0.0.1:3000"]
  116 
  117 GRAPHENE = {"SCHEMA": "factsheet.schema.schema"}
  118 
  119 WSGI_APPLICATION = "oeplatform.wsgi.application"
  120 
  121 try:
  122     ONTOLOGY_FOLDER  # noqa
  123 except NameError:
  124     ONTOLOGY_FOLDER = "/tmp"
  125 
  126 # Internationalization
  127 # https://docs.djangoproject.com/en/1.8/topics/i18n/
  128 
  129 LANGUAGE_CODE = "en-us"
  130 
  131 TIME_ZONE = "Europe/Berlin"
  132 
  133 USE_I18N = True
  134 
  135 USE_L10N = True
  136 
  137 USE_TZ = True
  138 
  139 # Static files (CSS, JavaScript, Images)
  140 # https://docs.djangoproject.com/en/1.8/howto/static-files/
  141 
  142 AUTH_USER_MODEL = "login.myuser"
  143 LOGIN_URL = "/user/login"
  144 LOGIN_REDIRECT_URL = "/"
  145 
  146 REST_FRAMEWORK = {
  147     "DEFAULT_AUTHENTICATION_CLASSES": (
  148         "rest_framework.authentication.BasicAuthentication",
  149         "rest_framework.authentication.SessionAuthentication",
  150         "rest_framework.authentication.TokenAuthentication",
  151     )
  152 }
  153 
  154 AUTHENTICATION_BACKENDS = [
  155     # AxesBackend should be the first backend in the AUTHENTICATION_BACKENDS list.
  156     "axes.backends.AxesBackend",
  157     # custom class extenging Django ModelBackend for login with username OR email
  158     "login.backends.ModelBackendWithEmail",
  159 ]
  160 
  161 DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
  162
  ```
  --- 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/oeplatform/settings.py b/oeplatform/settings.py
  --- a/oeplatform/settings.py
  +++ b/oeplatform/settings.py
  @@ -56,6 +56,7 @@
       "fontawesome_5",
       "django_better_admin_arrayfield",
       "oeo_viewer",
  +    "compressor",
   )
   
   MIDDLEWARE = (
  @@ -159,3 +160,12 @@
   ]
   
   DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
  +
  +STATICFILES_FINDERS = {
  +    'django.contrib.staticfiles.finders.FileSystemFinder',
  +    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  +    'compressor.finders.CompressorFinder',
  +}
  +
  +COMPRESS_ENABLED = True
  +COMPRESS_OFFLINE = True
  
verification_info: {"golden_diff": "diff --git a/oeplatform/settings.py b/oeplatform/settings.py\n--- a/oeplatform/settings.py\n+++ b/oeplatform/settings.py\n@@ -56,6 +56,7 @@\n     \"fontawesome_5\",\n     \"django_better_admin_arrayfield\",\n     \"oeo_viewer\",\n+    \"compressor\",\n )\n \n MIDDLEWARE = (\n@@ -159,3 +160,12 @@\n ]\n \n DEFAULT_AUTO_FIELD = \"django.db.models.AutoField\"\n+\n+STATICFILES_FINDERS = {\n+    'django.contrib.staticfiles.finders.FileSystemFinder',\n+    'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n+    'compressor.finders.CompressorFinder',\n+}\n+\n+COMPRESS_ENABLED = True\n+COMPRESS_OFFLINE = True\n", "issue": "Inconvenience of client cache update upon releasing/deploy new versions\n## Description of the issue\r\n\r\nWhen deploying a new version of an application, users are inconvenienced as they need to manually refresh the client cache to see the latest changes.\r\n\r\n## Ideas of solution\r\n\r\nChatGPT suggested to introduce a Cache Busting Mechanism. We could use this existing lib [django-compressor](https://github.com/django-compressor/django-compressor).\r\n\r\n> To set up a cache-busting mechanism in your Django application, you can use the Django extension module \"django-compressor\". Django Compressor allows you to compress static resources such as CSS and JavaScript files and assign them a unique hash value based on their content. This automatically changes the URL of the resources whenever they are modified.\r\n\r\n## Workflow checklist\r\n- [x] I am aware of the workflow in [CONTRIBUTING.md](https://github.com/OpenEnergyPlatform/oeplatform/blob/develop/CONTRIBUTING.md)\r\n\n", "before_files": [{"content": "\"\"\"\nDjango settings for oeplatform project.\n\nGenerated by 'django-admin startproject' using Django 1.8.5.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.8/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.8/ref/settings/\n\"\"\"\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\n\ntry:\n    from .securitysettings import *  # noqa\nexcept ImportError:\n    import logging\n    import os\n\n    logging.error(\"No securitysettings found. Triggerd in oeplatform/settings.py\")\n    SECRET_KEY = os.environ.get(\"SECRET_KEY\", \"0\")\n    DEFAULT_FROM_EMAIL = os.environ.get(\"DEFAULT_FROM_EMAIL\")\n    URL = os.environ.get(\"URL\")\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/\n\n# Application definition\n\nINSTALLED_APPS = (\n    \"django.contrib.sites\",\n    \"django.contrib.admin\",\n    \"django.contrib.auth\",\n    \"django.contrib.contenttypes\",\n    \"django.contrib.sessions\",\n    \"django.contrib.messages\",\n    \"django.contrib.staticfiles\",\n    \"django.contrib.sessions.backends.signed_cookies\",\n    \"django_bootstrap5\",\n    \"rest_framework\",\n    \"rest_framework.authtoken\",\n    \"modelview\",\n    \"modelview.templatetags.modelview_extras\",\n    \"login\",\n    \"base\",\n    \"base.templatetags.base_tags\",\n    \"widget_tweaks\",\n    \"dataedit\",\n    \"colorfield\",\n    \"api\",\n    \"ontology\",\n    \"axes\",\n    \"captcha\",\n    \"django.contrib.postgres\",\n    \"fontawesome_5\",\n    \"django_better_admin_arrayfield\",\n    \"oeo_viewer\",\n)\n\nMIDDLEWARE = (\n    \"django.contrib.sites.middleware.CurrentSiteMiddleware\",\n    \"django.contrib.sessions.middleware.SessionMiddleware\",\n    \"django.middleware.common.CommonMiddleware\",\n    \"django.middleware.csrf.CsrfViewMiddleware\",\n    \"django.contrib.auth.middleware.AuthenticationMiddleware\",\n    \"django.contrib.messages.middleware.MessageMiddleware\",\n    \"django.middleware.clickjacking.XFrameOptionsMiddleware\",\n    \"django.middleware.security.SecurityMiddleware\",\n    \"login.middleware.DetachMiddleware\",\n    \"axes.middleware.AxesMiddleware\",\n    \"django.middleware.common.CommonMiddleware\",\n)\n\nROOT_URLCONF = \"oeplatform.urls\"\n\nEXTERNAL_URLS = {\n    \"tutorials_index\": \"https://openenergyplatform.github.io/academy/\",\n    \"tutorials_faq\": \"https://openenergyplatform.github.io/academy/\",\n    \"tutorials_api1\": \"https://openenergyplatform.github.io/academy/tutorials/api/OEP_API_tutorial_part1/\",  # noqa E501\n    \"tutorials_licenses\": \"https://openenergyplatform.github.io/academy/tutorials/metadata/tutorial_open-data-licenses/\",\n    # noqa E501\n    \"readthedocs\": \"https://oeplatform.readthedocs.io/en/latest/?badge=latest\",\n    \"compendium\": \"https://openenergyplatform.github.io/organisation/\",\n}\n\n\ndef external_urls_context_processor(request):\n    \"\"\"Define hard coded external urls here.\n    Use in templates like this: {{ EXTERNAL_URLS.<name_of_url> }}\n    Also, you may want to add an icon indicating external links, e.g.\n    \"\"\"\n    return {\"EXTERNAL_URLS\": EXTERNAL_URLS}\n\n\nSITE_ID = 1\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [],\n        \"APP_DIRS\": True,\n        \"OPTIONS\": {\n            \"context_processors\": [\n                \"django.template.context_processors.debug\",\n                \"django.template.context_processors.request\",\n                \"django.contrib.auth.context_processors.auth\",\n                \"django.contrib.messages.context_processors.messages\",\n                \"oeplatform.settings.external_urls_context_processor\",\n            ]\n        },\n    }\n]\n\nCORS_ORIGIN_WHITELIST = [\"http://localhost:3000\", \"http://127.0.0.1:3000\"]\n\nGRAPHENE = {\"SCHEMA\": \"factsheet.schema.schema\"}\n\nWSGI_APPLICATION = \"oeplatform.wsgi.application\"\n\ntry:\n    ONTOLOGY_FOLDER  # noqa\nexcept NameError:\n    ONTOLOGY_FOLDER = \"/tmp\"\n\n# Internationalization\n# https://docs.djangoproject.com/en/1.8/topics/i18n/\n\nLANGUAGE_CODE = \"en-us\"\n\nTIME_ZONE = \"Europe/Berlin\"\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/1.8/howto/static-files/\n\nAUTH_USER_MODEL = \"login.myuser\"\nLOGIN_URL = \"/user/login\"\nLOGIN_REDIRECT_URL = \"/\"\n\nREST_FRAMEWORK = {\n    \"DEFAULT_AUTHENTICATION_CLASSES\": (\n        \"rest_framework.authentication.BasicAuthentication\",\n        \"rest_framework.authentication.SessionAuthentication\",\n        \"rest_framework.authentication.TokenAuthentication\",\n    )\n}\n\nAUTHENTICATION_BACKENDS = [\n    # AxesBackend should be the first backend in the AUTHENTICATION_BACKENDS list.\n    \"axes.backends.AxesBackend\",\n    # custom class extenging Django ModelBackend for login with username OR email\n    \"login.backends.ModelBackendWithEmail\",\n]\n\nDEFAULT_AUTO_FIELD = \"django.db.models.AutoField\"\n", "path": "oeplatform/settings.py"}], "after_files": [{"content": "\"\"\"\nDjango settings for oeplatform project.\n\nGenerated by 'django-admin startproject' using Django 1.8.5.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.8/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/1.8/ref/settings/\n\"\"\"\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\n\ntry:\n    from .securitysettings import *  # noqa\nexcept ImportError:\n    import logging\n    import os\n\n    logging.error(\"No securitysettings found. Triggerd in oeplatform/settings.py\")\n    SECRET_KEY = os.environ.get(\"SECRET_KEY\", \"0\")\n    DEFAULT_FROM_EMAIL = os.environ.get(\"DEFAULT_FROM_EMAIL\")\n    URL = os.environ.get(\"URL\")\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/\n\n# Application definition\n\nINSTALLED_APPS = (\n    \"django.contrib.sites\",\n    \"django.contrib.admin\",\n    \"django.contrib.auth\",\n    \"django.contrib.contenttypes\",\n    \"django.contrib.sessions\",\n    \"django.contrib.messages\",\n    \"django.contrib.staticfiles\",\n    \"django.contrib.sessions.backends.signed_cookies\",\n    \"django_bootstrap5\",\n    \"rest_framework\",\n    \"rest_framework.authtoken\",\n    \"modelview\",\n    \"modelview.templatetags.modelview_extras\",\n    \"login\",\n    \"base\",\n    \"base.templatetags.base_tags\",\n    \"widget_tweaks\",\n    \"dataedit\",\n    \"colorfield\",\n    \"api\",\n    \"ontology\",\n    \"axes\",\n    \"captcha\",\n    \"django.contrib.postgres\",\n    \"fontawesome_5\",\n    \"django_better_admin_arrayfield\",\n    \"oeo_viewer\",\n    \"compressor\",\n)\n\nMIDDLEWARE = (\n    \"django.contrib.sites.middleware.CurrentSiteMiddleware\",\n    \"django.contrib.sessions.middleware.SessionMiddleware\",\n    \"django.middleware.common.CommonMiddleware\",\n    \"django.middleware.csrf.CsrfViewMiddleware\",\n    \"django.contrib.auth.middleware.AuthenticationMiddleware\",\n    \"django.contrib.messages.middleware.MessageMiddleware\",\n    \"django.middleware.clickjacking.XFrameOptionsMiddleware\",\n    \"django.middleware.security.SecurityMiddleware\",\n    \"login.middleware.DetachMiddleware\",\n    \"axes.middleware.AxesMiddleware\",\n    \"django.middleware.common.CommonMiddleware\",\n)\n\nROOT_URLCONF = \"oeplatform.urls\"\n\nEXTERNAL_URLS = {\n    \"tutorials_index\": \"https://openenergyplatform.github.io/academy/\",\n    \"tutorials_faq\": \"https://openenergyplatform.github.io/academy/\",\n    \"tutorials_api1\": \"https://openenergyplatform.github.io/academy/tutorials/api/OEP_API_tutorial_part1/\",  # noqa E501\n    \"tutorials_licenses\": \"https://openenergyplatform.github.io/academy/tutorials/metadata/tutorial_open-data-licenses/\",\n    # noqa E501\n    \"readthedocs\": \"https://oeplatform.readthedocs.io/en/latest/?badge=latest\",\n    \"compendium\": \"https://openenergyplatform.github.io/organisation/\",\n}\n\n\ndef external_urls_context_processor(request):\n    \"\"\"Define hard coded external urls here.\n    Use in templates like this: {{ EXTERNAL_URLS.<name_of_url> }}\n    Also, you may want to add an icon indicating external links, e.g.\n    \"\"\"\n    return {\"EXTERNAL_URLS\": EXTERNAL_URLS}\n\n\nSITE_ID = 1\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [],\n        \"APP_DIRS\": True,\n        \"OPTIONS\": {\n            \"context_processors\": [\n                \"django.template.context_processors.debug\",\n                \"django.template.context_processors.request\",\n                \"django.contrib.auth.context_processors.auth\",\n                \"django.contrib.messages.context_processors.messages\",\n                \"oeplatform.settings.external_urls_context_processor\",\n            ]\n        },\n    }\n]\n\nCORS_ORIGIN_WHITELIST = [\"http://localhost:3000\", \"http://127.0.0.1:3000\"]\n\nGRAPHENE = {\"SCHEMA\": \"factsheet.schema.schema\"}\n\nWSGI_APPLICATION = \"oeplatform.wsgi.application\"\n\ntry:\n    ONTOLOGY_FOLDER  # noqa\nexcept NameError:\n    ONTOLOGY_FOLDER = \"/tmp\"\n\n# Internationalization\n# https://docs.djangoproject.com/en/1.8/topics/i18n/\n\nLANGUAGE_CODE = \"en-us\"\n\nTIME_ZONE = \"Europe/Berlin\"\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/1.8/howto/static-files/\n\nAUTH_USER_MODEL = \"login.myuser\"\nLOGIN_URL = \"/user/login\"\nLOGIN_REDIRECT_URL = \"/\"\n\nREST_FRAMEWORK = {\n    \"DEFAULT_AUTHENTICATION_CLASSES\": (\n        \"rest_framework.authentication.BasicAuthentication\",\n        \"rest_framework.authentication.SessionAuthentication\",\n        \"rest_framework.authentication.TokenAuthentication\",\n    )\n}\n\nAUTHENTICATION_BACKENDS = [\n    # AxesBackend should be the first backend in the AUTHENTICATION_BACKENDS list.\n    \"axes.backends.AxesBackend\",\n    # custom class extenging Django ModelBackend for login with username OR email\n    \"login.backends.ModelBackendWithEmail\",\n]\n\nDEFAULT_AUTO_FIELD = \"django.db.models.AutoField\"\n\nSTATICFILES_FINDERS = {\n    'django.contrib.staticfiles.finders.FileSystemFinder',\n    'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n    'compressor.finders.CompressorFinder',\n}\n\nCOMPRESS_ENABLED = True\nCOMPRESS_OFFLINE = True\n", "path": "oeplatform/settings.py"}]}