Repository: cookiecutter/cookiecutter-django

Issue:
Docker Django 4.1 template reload behavior
Using Django 4.1 under Docker gives trouble in development with the changed default behavior of the template loading. Templates are cached until restart since the cached loader is added as default: https://docs.djangoproject.com/en/4.1/releases/4.1/#templates

My current workaround is adding the next snippet to local.py

```
TEMPLATES[0]["OPTIONS"]["loaders"] = [
    (
        "django.template.loaders.filesystem.Loader",
        [APPS_DIR / "templates"],
    ),
    "django.template.loaders.app_directories.Loader",
]
```
[Update Django] Django 4.1
4.1 requirements tables



## base.txt

| Name | Version in Master | 4.1 Compatible Version | OK |
| ---- | :---------------: | :-----------------------------: | :-: |
| [pytz](http://pythonhosted.org/pytz) | 2023.3 | n/a | ✅ |
| [python-slugify](https://github.com/un33k/python-slugify) | 8.0.1 | n/a | ✅ |
| [Pillow](https://python-pillow.org) | 9.5.0 | n/a | ✅ |
| [rcssmin](http://opensource.perlig.de/rcssmin/) | 1.1.1 | n/a | ✅ |
| [argon2-cffi](https://pypi.org/project/argon2-cffi/) | 21.3.0 | n/a | ✅ |
| [whitenoise](https://github.com/evansd/whitenoise) | 6.4.0 | 6.2.0 | ✅ |
| [redis](https://github.com/redis/redis-py) | 4.5.4 | n/a | ✅ |
| [hiredis](https://github.com/redis/hiredis-py) | 2.2.2 | n/a | ✅ |
| [celery](http://celeryproject.org) | 5.2.7 | n/a | ✅ |
| [django-celery-beat](https://github.com/celery/django-celery-beat) | 2.5.0 | 2.4.0 | ✅ |
| [flower](https://github.com/mher/flower) | 1.2.0 | n/a | ✅ |
| [uvicorn](https://pypi.org/project/uvicorn/) | 0.21.1 | n/a | ✅ |
| [django](https://www.djangoproject.com/) | 4.0.10 | 2.4.0 | ✅ |
| [django-environ](https://django-environ.readthedocs.org) | 0.10.0 |  | ❓ |
| [django-model-utils](https://github.com/jazzband/django-model-utils) | 4.3.1 | 4.3.1 | ✅ |
| [django-allauth](http://www.intenct.nl/projects/django-allauth/) | 0.54.0 | 0.52.0 | ✅ |
| [django-crispy-forms](https://pypi.org/project/django-crispy-forms/) | 2.0 | 2.0 | ✅ |
| [crispy-bootstrap5](https://github.com/django-crispy-forms/crispy-bootstrap5) | 0.7 | 0.7 | ✅ |
| [django-compressor](https://django-compressor.readthedocs.io/en/latest/) | 4.3.1 | 4.1 | ✅ |
| [django-redis](https://github.com/jazzband/django-redis) | 5.2.0 |  | ❌ |
| [djangorestframework](https://www.django-rest-framework.org/) | 3.14.0 | 3.14.0 | ✅ |
| [django-cors-headers](https://github.com/adamchainz/django-cors-headers) | 3.14.0 | 3.13.0 | ✅ |
| [drf-spectacular](https://github.com/tfranzel/drf-spectacular) | 0.26.1 | 0.24.0 | ✅ |
| [django-webpack-loader](https://github.com/django-webpack/django-webpack-loader) | 1.8.1 | 1.8.0 | ✅ |


## local.txt

| Name | Version in Master | 4.1 Compatible Version | OK |
| ---- | :---------------: | :-----------------------------: | :-: |
| [Werkzeug](https://palletsprojects.com/p/werkzeug/) | 2.2.3 | n/a | ✅ |
| [ipdb](https://github.com/gotcha/ipdb) | 0.13.13 | n/a | ✅ |
| [psycopg2](https://psycopg.org/) | 2.9.6 | n/a | ✅ |
| [psycopg2-binary](https://psycopg.org/) | 2.9.6 | n/a | ✅ |
| [watchfiles](https://github.com/samuelcolvin/watchfiles/watchfiles) | 0.19.0 | n/a | ✅ |
| [mypy](http://www.mypy-lang.org/) | 1.1.1 | n/a | ✅ |
| [django-stubs](https://github.com/typeddjango/django-stubs) | 1.16.0 | 1.13.0 | ✅ |
| [pytest](https://docs.pytest.org/en/latest/) | 7.2.2 | n/a | ✅ |
| [pytest-sugar](https://pivotfinland.com/pytest-sugar/) | 0.9.6 | n/a | ✅ |
| [djangorestframework-stubs](https://github.com/typeddjango/djangorestframework-stubs) | 1.10.0 | n/a | ✅ |
| [sphinx](https://pypi.org/project/Sphinx/) | 6.1.3 | n/a | ✅ |
| [sphinx-autobuild](https://github.com/executablebooks/sphinx-autobuild) | 2021.3.14 | n/a | ✅ |
| [flake8](https://github.com/pycqa/flake8) | 6.0.0 | n/a | ✅ |
| [flake8-isort](https://github.com/gforcada/flake8-isort) | 6.0.0 | n/a | ✅ |
| [coverage](https://github.com/nedbat/coveragepy) | 7.2.2 | n/a | ✅ |
| [black](https://pypi.org/project/black/) | 23.3.0 | n/a | ✅ |
| [pylint-django](https://github.com/PyCQA/pylint-django) | 2.5.3 |  | ❌ |
| [pylint-celery](https://github.com/landscapeio/pylint-celery) | 0.3 | n/a | ✅ |
| [pre-commit](https://github.com/pre-commit/pre-commit) | 3.2.1 | n/a | ✅ |
| [factory-boy](https://github.com/FactoryBoy/factory_boy) | 3.2.1 |  | ❌ |
| [django-debug-toolbar](https://pypi.org/project/django-debug-toolbar/) | 3.8.1 | 3.6.0 | ✅ |
| [django-extensions](http://github.com/django-extensions/django-extensions) | 3.2.1 | 3.2.1 | ✅ |
| [django-coverage-plugin](https://github.com/nedbat/django_coverage_plugin) | 3.0.0 | 2.0.4 | ✅ |
| [pytest-django](https://pytest-django.readthedocs.io/) | 4.5.2 |  | ❌ |


## production.txt

| Name | Version in Master | 4.1 Compatible Version | OK |
| ---- | :---------------: | :-----------------------------: | :-: |
| [gunicorn](https://gunicorn.org) | 20.1.0 | n/a | ✅ |
| [psycopg2](https://psycopg.org/) | 2.9.6 | n/a | ✅ |
| [Collectfast](https://github.com/antonagestam/collectfast/) | 2.2.0 | n/a | ✅ |
| [sentry-sdk](https://github.com/getsentry/sentry-python) | 1.17.0 | n/a | ✅ |
| [hiredis](https://github.com/redis/hiredis-py) | 2.2.2 | n/a | ✅ |
| [django-storages](https://github.com/jschneier/django-storages) | 1.13.2 | 1.13 | ✅ |
| [django-anymail](https://github.com/anymail/django-anymail) | 9.1 | 9.0 | ✅ |



Discussion:
Issue is with runserver_plus: https://github.com/django-extensions/django-extensions/issues/1766 `runserver` does not have this issue.
In my opinion is this the last blocking issue for updating to Django 4.1. There is a [fix](https://github.com/django-extensions/django-extensions/pull/1775) already present but it awaits approval. 

We can decide to drop `runserver_plus` in favor of `runserver` but does not have my preferences since it requires more changes. 
Thanks for your efforts in researching and fixing these issues upstream.


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@
     classifiers=[
         "Development Status :: 4 - Beta",
         "Environment :: Console",
-        "Framework :: Django :: 4.0",
+        "Framework :: Django :: 4.1",
         "Intended Audience :: Developers",
         "Natural Language :: English",
         "License :: OSI Approved :: BSD License",


Test patch: