prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Fresh Kolibri dev environment fails to install properly
  ## Observed behavior
  
  I took these steps:
  
  - Clone Kolibri to fresh local repo
  - Ensure `develop` is checked out
  - `python -m venv venv`
  - `source venv/bin/activate` 
  - `pip install -r` every file in the `requirements/` directory
  - `pip install -e .`
  - `yarn install`
  - `yarn devserver`
  
  Then I get the error noted below. Seems like Django isn't being installed correctly or something. I've copied the `venv` from another worktree in and the branch works as expected until I `pip install...` everything again.
  
  There was a recent bump to Morango in the requirements.txt but I can't imagine why that would cause this problem.
  
  ## Errors and logs
  <!--
  Relevant logs from:
   * the command line
   * ~/.kolibri/logs/kolibri.txt
   * the browser console
  
  Please wrap errors in triple backticks for clean formatting like this:
  ```
  01:10 info: something happened
  01:12 error: something bad happened
  ```
  -->
  
  ```
  ╰─ yarn devserver                                                                                                                                                                                                                                                                                                                                                                                                                          
  yarn run v1.22.15
  $ run-p python-devserver lint-frontend:watch:format hashi-dev watch
  
  > kolibri-root@0.12.0-dev.1 hashi-dev
  > yarn workspace hashi run dev
  
  
  > kolibri-root@0.12.0-dev.1 watch
  > kolibri-tools build dev --file ./build_tools/build_plugins.txt --cache
  
  
  > kolibri-root@0.12.0-dev.1 python-devserver
  > kolibri start --debug --foreground --port=8000 --settings=kolibri.deployment.default.settings.dev
  
  
  > kolibri-root@0.12.0-dev.1 lint-frontend:watch:format
  > yarn run lint-frontend --monitor --write
  
  $ kolibri-tools lint --pattern '{kolibri*/**/assets,packages,build_tools}/**/*.{js,vue,scss,less,css}' --ignore '**/dist/**,**/node_modules/**,**/static/**,**/kolibri-core-for-export/**' --monitor --write
  $ yarn run build-base --mode=development --watch
  $ webpack --config ./webpack.config.js --mode=development --watch
  INFO     Option DEBUG in section [Server] being overridden by environment variable KOLIBRI_DEBUG
  INFO     Option DEBUG_LOG_DATABASE in section [Server] being overridden by environment variable KOLIBRI_DEBUG_LOG_DATABASE
  INFO     Option RUN_MODE in section [Deployment] being overridden by environment variable KOLIBRI_RUN_MODE
  /home/jacob/kill-this-kolibri/venv/lib/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
    """)
  Error: Traceback (most recent call last):
    File "/home/jacob/kill-this-kolibri/kolibri/utils/cli.py", line 193, in invoke
      initialize(**get_initialize_params())
    File "/home/jacob/kill-this-kolibri/kolibri/utils/main.py", line 279, in initialize
      _setup_django()
    File "/home/jacob/kill-this-kolibri/kolibri/utils/main.py", line 153, in _setup_django
      django.setup()
    File "/home/jacob/kill-this-kolibri/venv/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
      apps.populate(settings.INSTALLED_APPS)
    File "/home/jacob/kill-this-kolibri/venv/lib/python3.6/site-packages/django/apps/registry.py", line 85, in populate
      app_config = AppConfig.create(entry)
    File "/home/jacob/kill-this-kolibri/venv/lib/python3.6/site-packages/django/apps/config.py", line 94, in create
      module = import_module(entry)
    File "/home/jacob/.pyenv/versions/3.6.12/lib/python3.6/importlib/__init__.py", line 126, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 994, in _gcd_import
    File "<frozen importlib._bootstrap>", line 971, in _find_and_load
    File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
  ModuleNotFoundError: No module named 'django_extensions'
  
  ERROR: "python-devserver" exited with 1.
  error Command failed with exit code 1.
  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  ```
  
  ## Expected behavior
  <!--
  Description of what behavior was expected but did not occur
  -->
  
  Server should start up without issue.
  
  ## User-facing consequences…
  
  <!--
  Implications and real-world consequences for learners, coaches, admins, and other users of the application
  -->
  
  Devs cannot create new working local environments.
  
  ## Steps to reproduce
  <!--
  Precise steps that someone else can follow in order to see this behavior
  -->
  
  See the above.
  
  ## Context
  <!--
  Tell us about your environment, including:
   * Kolibri version
   * Operating system
   * Browser
  -->
  
  `develop`
  Fedora
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `kolibri/deployment/default/settings/dev.py`
  Content:
  ```
  1 from __future__ import absolute_import
  2 from __future__ import print_function
  3 from __future__ import unicode_literals
  4 
  5 import os
  6 
  7 from .base import *  # noqa isort:skip @UnusedWildImport
  8 
  9 DEBUG = True
  10 
  11 # Settings might be tuples, so switch to lists
  12 INSTALLED_APPS = list(INSTALLED_APPS) + ["drf_yasg", "django_extensions"]  # noqa F405
  13 webpack_middleware = "kolibri.core.webpack.middleware.WebpackErrorHandler"
  14 no_login_popup_middleware = (
  15     "kolibri.core.auth.middleware.XhrPreventLoginPromptMiddleware"
  16 )
  17 MIDDLEWARE = list(MIDDLEWARE) + [  # noqa F405
  18     webpack_middleware,
  19     no_login_popup_middleware,
  20 ]
  21 
  22 INTERNAL_IPS = ["127.0.0.1"]
  23 
  24 ROOT_URLCONF = "kolibri.deployment.default.dev_urls"
  25 
  26 DEVELOPER_MODE = True
  27 os.environ.update({"KOLIBRI_DEVELOPER_MODE": "True"})
  28 
  29 try:
  30     process_cache = CACHES["process_cache"]  # noqa F405
  31 except KeyError:
  32     process_cache = None
  33 
  34 # Create a memcache for each cache
  35 CACHES = {
  36     key: {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}
  37     for key in CACHES  # noqa F405
  38 }
  39 
  40 if process_cache:
  41     CACHES["process_cache"] = process_cache
  42 
  43 
  44 REST_FRAMEWORK = {
  45     "UNAUTHENTICATED_USER": "kolibri.core.auth.models.KolibriAnonymousUser",
  46     "DEFAULT_AUTHENTICATION_CLASSES": [
  47         # Activate basic auth for external API testing tools
  48         "rest_framework.authentication.BasicAuthentication",
  49         "rest_framework.authentication.SessionAuthentication",
  50     ],
  51     "DEFAULT_RENDERER_CLASSES": (
  52         "rest_framework.renderers.JSONRenderer",
  53         "rest_framework.renderers.BrowsableAPIRenderer",
  54     ),
  55     "EXCEPTION_HANDLER": "kolibri.core.utils.exception_handler.custom_exception_handler",
  56 }
  57 
  58 SWAGGER_SETTINGS = {"DEFAULT_INFO": "kolibri.deployment.default.dev_urls.api_info"}
  59
  ```
  --- 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/kolibri/deployment/default/settings/dev.py b/kolibri/deployment/default/settings/dev.py
  --- a/kolibri/deployment/default/settings/dev.py
  +++ b/kolibri/deployment/default/settings/dev.py
  @@ -9,7 +9,7 @@
   DEBUG = True
   
   # Settings might be tuples, so switch to lists
  -INSTALLED_APPS = list(INSTALLED_APPS) + ["drf_yasg", "django_extensions"]  # noqa F405
  +INSTALLED_APPS = list(INSTALLED_APPS) + ["drf_yasg"]  # noqa F405
   webpack_middleware = "kolibri.core.webpack.middleware.WebpackErrorHandler"
   no_login_popup_middleware = (
       "kolibri.core.auth.middleware.XhrPreventLoginPromptMiddleware"
  
verification_info: {"golden_diff": "diff --git a/kolibri/deployment/default/settings/dev.py b/kolibri/deployment/default/settings/dev.py\n--- a/kolibri/deployment/default/settings/dev.py\n+++ b/kolibri/deployment/default/settings/dev.py\n@@ -9,7 +9,7 @@\n DEBUG = True\n \n # Settings might be tuples, so switch to lists\n-INSTALLED_APPS = list(INSTALLED_APPS) + [\"drf_yasg\", \"django_extensions\"]  # noqa F405\n+INSTALLED_APPS = list(INSTALLED_APPS) + [\"drf_yasg\"]  # noqa F405\n webpack_middleware = \"kolibri.core.webpack.middleware.WebpackErrorHandler\"\n no_login_popup_middleware = (\n     \"kolibri.core.auth.middleware.XhrPreventLoginPromptMiddleware\"\n", "issue": "Fresh Kolibri dev environment fails to install properly\n## Observed behavior\r\n\r\nI took these steps:\r\n\r\n- Clone Kolibri to fresh local repo\r\n- Ensure `develop` is checked out\r\n- `python -m venv venv`\r\n- `source venv/bin/activate` \r\n- `pip install -r` every file in the `requirements/` directory\r\n- `pip install -e .`\r\n- `yarn install`\r\n- `yarn devserver`\r\n\r\nThen I get the error noted below. Seems like Django isn't being installed correctly or something. I've copied the `venv` from another worktree in and the branch works as expected until I `pip install...` everything again.\r\n\r\nThere was a recent bump to Morango in the requirements.txt but I can't imagine why that would cause this problem.\r\n\r\n## Errors and logs\r\n<!--\r\nRelevant logs from:\r\n * the command line\r\n * ~/.kolibri/logs/kolibri.txt\r\n * the browser console\r\n\r\nPlease wrap errors in triple backticks for clean formatting like this:\r\n```\r\n01:10 info: something happened\r\n01:12 error: something bad happened\r\n```\r\n-->\r\n\r\n```\r\n\u2570\u2500 yarn devserver                                                                                                                                                                                                                                                                                                                                                                                                                          \r\nyarn run v1.22.15\r\n$ run-p python-devserver lint-frontend:watch:format hashi-dev watch\r\n\r\n> kolibri-root@0.12.0-dev.1 hashi-dev\r\n> yarn workspace hashi run dev\r\n\r\n\r\n> kolibri-root@0.12.0-dev.1 watch\r\n> kolibri-tools build dev --file ./build_tools/build_plugins.txt --cache\r\n\r\n\r\n> kolibri-root@0.12.0-dev.1 python-devserver\r\n> kolibri start --debug --foreground --port=8000 --settings=kolibri.deployment.default.settings.dev\r\n\r\n\r\n> kolibri-root@0.12.0-dev.1 lint-frontend:watch:format\r\n> yarn run lint-frontend --monitor --write\r\n\r\n$ kolibri-tools lint --pattern '{kolibri*/**/assets,packages,build_tools}/**/*.{js,vue,scss,less,css}' --ignore '**/dist/**,**/node_modules/**,**/static/**,**/kolibri-core-for-export/**' --monitor --write\r\n$ yarn run build-base --mode=development --watch\r\n$ webpack --config ./webpack.config.js --mode=development --watch\r\nINFO     Option DEBUG in section [Server] being overridden by environment variable KOLIBRI_DEBUG\r\nINFO     Option DEBUG_LOG_DATABASE in section [Server] being overridden by environment variable KOLIBRI_DEBUG_LOG_DATABASE\r\nINFO     Option RUN_MODE in section [Deployment] being overridden by environment variable KOLIBRI_RUN_MODE\r\n/home/jacob/kill-this-kolibri/venv/lib/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use \"pip install psycopg2-binary\" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.\r\n  \"\"\")\r\nError: Traceback (most recent call last):\r\n  File \"/home/jacob/kill-this-kolibri/kolibri/utils/cli.py\", line 193, in invoke\r\n    initialize(**get_initialize_params())\r\n  File \"/home/jacob/kill-this-kolibri/kolibri/utils/main.py\", line 279, in initialize\r\n    _setup_django()\r\n  File \"/home/jacob/kill-this-kolibri/kolibri/utils/main.py\", line 153, in _setup_django\r\n    django.setup()\r\n  File \"/home/jacob/kill-this-kolibri/venv/lib/python3.6/site-packages/django/__init__.py\", line 27, in setup\r\n    apps.populate(settings.INSTALLED_APPS)\r\n  File \"/home/jacob/kill-this-kolibri/venv/lib/python3.6/site-packages/django/apps/registry.py\", line 85, in populate\r\n    app_config = AppConfig.create(entry)\r\n  File \"/home/jacob/kill-this-kolibri/venv/lib/python3.6/site-packages/django/apps/config.py\", line 94, in create\r\n    module = import_module(entry)\r\n  File \"/home/jacob/.pyenv/versions/3.6.12/lib/python3.6/importlib/__init__.py\", line 126, in import_module\r\n    return _bootstrap._gcd_import(name[level:], package, level)\r\n  File \"<frozen importlib._bootstrap>\", line 994, in _gcd_import\r\n  File \"<frozen importlib._bootstrap>\", line 971, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 953, in _find_and_load_unlocked\r\nModuleNotFoundError: No module named 'django_extensions'\r\n\r\nERROR: \"python-devserver\" exited with 1.\r\nerror Command failed with exit code 1.\r\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\r\n```\r\n\r\n## Expected behavior\r\n<!--\r\nDescription of what behavior was expected but did not occur\r\n-->\r\n\r\nServer should start up without issue.\r\n\r\n## User-facing consequences\u2026\r\n\r\n<!--\r\nImplications and real-world consequences for learners, coaches, admins, and other users of the application\r\n-->\r\n\r\nDevs cannot create new working local environments.\r\n\r\n## Steps to reproduce\r\n<!--\r\nPrecise steps that someone else can follow in order to see this behavior\r\n-->\r\n\r\nSee the above.\r\n\r\n## Context\r\n<!--\r\nTell us about your environment, including:\r\n * Kolibri version\r\n * Operating system\r\n * Browser\r\n-->\r\n\r\n`develop`\r\nFedora\n", "before_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport os\n\nfrom .base import *  # noqa isort:skip @UnusedWildImport\n\nDEBUG = True\n\n# Settings might be tuples, so switch to lists\nINSTALLED_APPS = list(INSTALLED_APPS) + [\"drf_yasg\", \"django_extensions\"]  # noqa F405\nwebpack_middleware = \"kolibri.core.webpack.middleware.WebpackErrorHandler\"\nno_login_popup_middleware = (\n    \"kolibri.core.auth.middleware.XhrPreventLoginPromptMiddleware\"\n)\nMIDDLEWARE = list(MIDDLEWARE) + [  # noqa F405\n    webpack_middleware,\n    no_login_popup_middleware,\n]\n\nINTERNAL_IPS = [\"127.0.0.1\"]\n\nROOT_URLCONF = \"kolibri.deployment.default.dev_urls\"\n\nDEVELOPER_MODE = True\nos.environ.update({\"KOLIBRI_DEVELOPER_MODE\": \"True\"})\n\ntry:\n    process_cache = CACHES[\"process_cache\"]  # noqa F405\nexcept KeyError:\n    process_cache = None\n\n# Create a memcache for each cache\nCACHES = {\n    key: {\"BACKEND\": \"django.core.cache.backends.locmem.LocMemCache\"}\n    for key in CACHES  # noqa F405\n}\n\nif process_cache:\n    CACHES[\"process_cache\"] = process_cache\n\n\nREST_FRAMEWORK = {\n    \"UNAUTHENTICATED_USER\": \"kolibri.core.auth.models.KolibriAnonymousUser\",\n    \"DEFAULT_AUTHENTICATION_CLASSES\": [\n        # Activate basic auth for external API testing tools\n        \"rest_framework.authentication.BasicAuthentication\",\n        \"rest_framework.authentication.SessionAuthentication\",\n    ],\n    \"DEFAULT_RENDERER_CLASSES\": (\n        \"rest_framework.renderers.JSONRenderer\",\n        \"rest_framework.renderers.BrowsableAPIRenderer\",\n    ),\n    \"EXCEPTION_HANDLER\": \"kolibri.core.utils.exception_handler.custom_exception_handler\",\n}\n\nSWAGGER_SETTINGS = {\"DEFAULT_INFO\": \"kolibri.deployment.default.dev_urls.api_info\"}\n", "path": "kolibri/deployment/default/settings/dev.py"}], "after_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport os\n\nfrom .base import *  # noqa isort:skip @UnusedWildImport\n\nDEBUG = True\n\n# Settings might be tuples, so switch to lists\nINSTALLED_APPS = list(INSTALLED_APPS) + [\"drf_yasg\"]  # noqa F405\nwebpack_middleware = \"kolibri.core.webpack.middleware.WebpackErrorHandler\"\nno_login_popup_middleware = (\n    \"kolibri.core.auth.middleware.XhrPreventLoginPromptMiddleware\"\n)\nMIDDLEWARE = list(MIDDLEWARE) + [  # noqa F405\n    webpack_middleware,\n    no_login_popup_middleware,\n]\n\nINTERNAL_IPS = [\"127.0.0.1\"]\n\nROOT_URLCONF = \"kolibri.deployment.default.dev_urls\"\n\nDEVELOPER_MODE = True\nos.environ.update({\"KOLIBRI_DEVELOPER_MODE\": \"True\"})\n\ntry:\n    process_cache = CACHES[\"process_cache\"]  # noqa F405\nexcept KeyError:\n    process_cache = None\n\n# Create a memcache for each cache\nCACHES = {\n    key: {\"BACKEND\": \"django.core.cache.backends.locmem.LocMemCache\"}\n    for key in CACHES  # noqa F405\n}\n\nif process_cache:\n    CACHES[\"process_cache\"] = process_cache\n\n\nREST_FRAMEWORK = {\n    \"UNAUTHENTICATED_USER\": \"kolibri.core.auth.models.KolibriAnonymousUser\",\n    \"DEFAULT_AUTHENTICATION_CLASSES\": [\n        # Activate basic auth for external API testing tools\n        \"rest_framework.authentication.BasicAuthentication\",\n        \"rest_framework.authentication.SessionAuthentication\",\n    ],\n    \"DEFAULT_RENDERER_CLASSES\": (\n        \"rest_framework.renderers.JSONRenderer\",\n        \"rest_framework.renderers.BrowsableAPIRenderer\",\n    ),\n    \"EXCEPTION_HANDLER\": \"kolibri.core.utils.exception_handler.custom_exception_handler\",\n}\n\nSWAGGER_SETTINGS = {\"DEFAULT_INFO\": \"kolibri.deployment.default.dev_urls.api_info\"}\n", "path": "kolibri/deployment/default/settings/dev.py"}]}