From 3b3f5db60dbc85823ca3eff102adca54a60643d3 Mon Sep 17 00:00:00 2001 From: Tim Gates Date: Thu, 12 Mar 2020 06:40:15 +1100 Subject: [PATCH 01/26] docs: Fix simple typo, wheter -> whether There is a small typo in docs/values.rst. Should read `whether` rather than `wheter`. --- docs/values.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/values.rst b/docs/values.rst index 5f5dcea..8f11ae4 100644 --- a/docs/values.rst +++ b/docs/values.rst @@ -162,7 +162,7 @@ the prefix. :param environ: toggle for environment use :param environ_name: name of environment variable to look for :param environ_prefix: prefix to use when looking for environment variable - :param environ_required: wheter or not the value is required to be set as an environment variable + :param environ_required: whether or not the value is required to be set as an environment variable :type environ: bool :type environ_name: capitalized string or None :type environ_prefix: capitalized string From ac6d31bb8310d3c3915d696d919429c2a0aa5a89 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 24 Mar 2020 10:52:41 +0100 Subject: [PATCH 02/26] testing: remove django-discover-runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit project supports Django 1.11+ > https://pypi.org/project/django-discover-runner/ This runner has been added to Django 1.6 as the default test runner. If you use Django 1.6 or above you don’t need this app. fix #250 --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index add1cff..b032109 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,6 @@ setup( 'email': ['dj-email-url'], 'search': ['dj-search-url'], 'testing': [ - 'django-discover-runner', 'mock', 'django-cache-url>=1.0.0', 'dj-database-url', From 566af30ce69a627bff8dab872e5698c3f6833e4d Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Fri, 29 May 2020 12:15:08 +0200 Subject: [PATCH 03/26] Fixed malformed links in documentation --- docs/cookbook.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cookbook.rst b/docs/cookbook.rst index bb5f048..9184172 100644 --- a/docs/cookbook.rst +++ b/docs/cookbook.rst @@ -332,8 +332,8 @@ Channels -------- If you want to deploy a project that uses the Django channels with -`Daphne ` as the -`interface server ` +`Daphne `_ as the +`interface server `_ you have to use a asgi.py script similar to the following: .. code-block:: python From b9648bddb305c00b3b6391465460bde1b82e5f73 Mon Sep 17 00:00:00 2001 From: Arseny Sokolov Date: Wed, 17 Jun 2020 23:38:48 +0800 Subject: [PATCH 04/26] Add DictValue example --- docs/values.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/values.rst b/docs/values.rst index 5f5dcea..6af72ea 100644 --- a/docs/values.rst +++ b/docs/values.rst @@ -353,6 +353,10 @@ Type values DEPARTMENTS = values.DictValue({ 'it': ['Mike', 'Joe'], }) + + Override using environment variables like this:: + + DJANGO_DEPARTMENTS={'it':['Mike','Joe'],'hr':['Emma','Olivia']} Validator values ^^^^^^^^^^^^^^^^ From f85ec1fb89b622c165c0198ce4b77da0fe450dd3 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Fri, 9 Apr 2021 00:20:36 -0400 Subject: [PATCH 05/26] Prevent an ImproperlyConfigured warning from DEFAULT_HASHING_ALGORITHM --- configurations/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configurations/base.py b/configurations/base.py index b1bc1e9..1d7e488 100644 --- a/configurations/base.py +++ b/configurations/base.py @@ -36,6 +36,9 @@ class ConfigurationBase(type): # https://github.com/django/django/commit/226ebb17290b604ef29e82fb5c1fbac3594ac163#diff-ec2bed07bb264cb95a80f08d71a47c06R163-R170 if "PASSWORD_RESET_TIMEOUT_DAYS" in attrs and "PASSWORD_RESET_TIMEOUT" in attrs: attrs.pop("PASSWORD_RESET_TIMEOUT_DAYS") + # https://docs.djangoproject.com/en/3.1/releases/3.1/#default-hashing-algorithm-settings + if "DEFAULT_HASHING_ALGORITHM" in attrs: + attrs.pop("DEFAULT_HASHING_ALGORITHM") return super().__new__(cls, name, bases, attrs) def __repr__(self): From 58a4f689ff4be35e4863ef0b87a1dbb35da536e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 12 Apr 2021 21:53:16 +0200 Subject: [PATCH 06/26] Require setuptools, configurations/version.py imports pkg_resources --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7a578e2..ebaa589 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ setup( 'django-cadmin = configurations.management:execute_from_command_line', ], }, - install_requires=[], + install_requires=["setuptools"], extras_require={ 'cache': ['django-cache-url'], 'database': ['dj-database-url'], From d715a719a4e0ec43dc3c28e56d11f74df39c8777 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Tue, 31 Aug 2021 21:28:16 -0400 Subject: [PATCH 07/26] Use a more general structure for removing deprecated settings --- configurations/base.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/configurations/base.py b/configurations/base.py index 1d7e488..24de460 100644 --- a/configurations/base.py +++ b/configurations/base.py @@ -32,13 +32,22 @@ class ConfigurationBase(type): for base in bases[::-1]: settings_vars.update(uppercase_attributes(base)) attrs = dict(settings_vars, **attrs) - # Fix ImproperlyConfigured issue introduced in Django + + deprecated_settings = { + # DEFAULT_HASHING_ALGORITHM is always deprecated, as it's a + # transitional setting + # https://docs.djangoproject.com/en/3.1/releases/3.1/#default-hashing-algorithm-settings + "DEFAULT_HASHING_ALGORITHM", + } + # PASSWORD_RESET_TIMEOUT_DAYS is deprecated in favor of + # PASSWORD_RESET_TIMEOUT in Django 3.1 # https://github.com/django/django/commit/226ebb17290b604ef29e82fb5c1fbac3594ac163#diff-ec2bed07bb264cb95a80f08d71a47c06R163-R170 - if "PASSWORD_RESET_TIMEOUT_DAYS" in attrs and "PASSWORD_RESET_TIMEOUT" in attrs: - attrs.pop("PASSWORD_RESET_TIMEOUT_DAYS") - # https://docs.djangoproject.com/en/3.1/releases/3.1/#default-hashing-algorithm-settings - if "DEFAULT_HASHING_ALGORITHM" in attrs: - attrs.pop("DEFAULT_HASHING_ALGORITHM") + if "PASSWORD_RESET_TIMEOUT" in attrs: + deprecated_settings.add("PASSWORD_RESET_TIMEOUT_DAYS") + for deprecated_setting in deprecated_settings: + if deprecated_setting in attrs: + del attrs[deprecated_setting] + return super().__new__(cls, name, bases, attrs) def __repr__(self): From 271f6fb5bb9d29cedae3f5c6a52d23988b109ad6 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Tue, 31 Aug 2021 22:01:34 -0400 Subject: [PATCH 08/26] Replace references to MIDDLEWARE_CLASSES with MIDDLEWARE MIDDLEWARE_CLASSES was removed in Django 2.0. --- docs/values.rst | 2 +- test_project/test_project/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/values.rst b/docs/values.rst index 5f5dcea..1d6aab4 100644 --- a/docs/values.rst +++ b/docs/values.rst @@ -547,7 +547,7 @@ Other values :: - MIDDLEWARE_CLASSES = values.BackendsValue([ + MIDDLEWARE = values.BackendsValue([ 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', diff --git a/test_project/test_project/settings.py b/test_project/test_project/settings.py index 295981c..5d89812 100644 --- a/test_project/test_project/settings.py +++ b/test_project/test_project/settings.py @@ -95,7 +95,7 @@ class Base(Configuration): 'django.template.loaders.app_directories.Loader', ) - MIDDLEWARE_CLASSES = ( + MIDDLEWARE = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', From 1ada7d14f769744efdfd19c207a83ff3a850f177 Mon Sep 17 00:00:00 2001 From: Richard de Wit Date: Tue, 14 Jan 2020 16:27:23 +0100 Subject: [PATCH 09/26] Add ASGI support Then in your project's `asgi.py` file use this: ```python from configurations.asgi import get_asgi_application application = get_asgi_application() ``` --- configurations/asgi.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 configurations/asgi.py diff --git a/configurations/asgi.py b/configurations/asgi.py new file mode 100644 index 0000000..b257d60 --- /dev/null +++ b/configurations/asgi.py @@ -0,0 +1,14 @@ +from . import importer + +importer.install() + +try: + from django.core.asgi import get_asgi_application +except ImportError: # pragma: no cover + from django.core.handlers.asgi import ASGIHandler + + def get_asgi_application(): # noqa + return ASGIHandler() + +# this is just for the crazy ones +application = get_asgi_application() From c1cb3874f24378d99d1f460eed7e73ab82be325c Mon Sep 17 00:00:00 2001 From: Finn-Thorben Sell Date: Thu, 9 Sep 2021 15:01:11 +0200 Subject: [PATCH 10/26] remove fallback onto ASGIHandler ASGIHandler is considered a django internal api with get_asgi_application being the public counterpart. get_asgi_application is also present since the introduction of django's asgi support so the ImportError should never occur anyways. --- configurations/asgi.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/configurations/asgi.py b/configurations/asgi.py index b257d60..7a28d29 100644 --- a/configurations/asgi.py +++ b/configurations/asgi.py @@ -2,13 +2,7 @@ from . import importer importer.install() -try: - from django.core.asgi import get_asgi_application -except ImportError: # pragma: no cover - from django.core.handlers.asgi import ASGIHandler - - def get_asgi_application(): # noqa - return ASGIHandler() +from django.core.asgi import get_asgi_application # this is just for the crazy ones application = get_asgi_application() From 2cae9838b559049efc979fb8b5f03765a1517abf Mon Sep 17 00:00:00 2001 From: Finn-Thorben Sell Date: Thu, 9 Sep 2021 15:08:42 +0200 Subject: [PATCH 11/26] add documentation to README about get_asgi_application --- README.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 536b154..7b9ac9f 100644 --- a/README.rst +++ b/README.rst @@ -120,5 +120,18 @@ The same applies to your **wsgi.py** file, e.g.: Here we don't use the default ``django.core.wsgi.get_wsgi_application`` function but instead ``configurations.wsgi.get_wsgi_application``. +Or if you are not serving your app via WSGI but ASGI instead, you need to modify your **asgi.py** file too.: + +.. code-block:: python + + import os + + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') + os.environ.setdefault('DJANGO_CONFIGURATION', 'DEV') + + from configurations.asgi import get_asgi_application + + application = get_asgi_application() + That's it! You can now use your project with ``manage.py`` and your favorite -WSGI enabled server. +WSGI/ASGI enabled server. From 6a4a620891cf2dfd6733a0cf63566d86d0d62507 Mon Sep 17 00:00:00 2001 From: Finn-Thorben Sell Date: Thu, 9 Sep 2021 15:11:49 +0200 Subject: [PATCH 12/26] add additional documentation references to asgi.py --- README.rst | 2 +- docs/cookbook.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 7b9ac9f..0716754 100644 --- a/README.rst +++ b/README.rst @@ -81,7 +81,7 @@ command line option, e.g. python manage.py runserver --settings=mysite.settings --configuration=Dev To enable Django to use your configuration you now have to modify your -**manage.py** or **wsgi.py** script to use django-configurations's versions +**manage.py**, **wsgi.py** or **asgi.py** script to use django-configurations's versions of the appropriate starter functions, e.g. a typical **manage.py** using django-configurations would look like this: diff --git a/docs/cookbook.rst b/docs/cookbook.rst index bb5f048..c34cae1 100644 --- a/docs/cookbook.rst +++ b/docs/cookbook.rst @@ -182,7 +182,7 @@ probably just add the following to the **beginning** of your settings module: import configurations configurations.setup() -That has the same effect as using the ``manage.py`` or ``wsgi.py`` utilities. +That has the same effect as using the ``manage.py``, ``wsgi.py`` or ``asgi.py`` utilities. This will also call ``django.setup()``. >= 3.1 From 68cbb437cf3560127d887169137b0c8b986d98f0 Mon Sep 17 00:00:00 2001 From: jazzband-bot Date: Mon, 25 Oct 2021 11:14:26 +0000 Subject: [PATCH 13/26] Jazzband: Created local 'CODE_OF_CONDUCT.md' from remote 'CODE_OF_CONDUCT.md' --- CODE_OF_CONDUCT.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..e0d5efa --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Code of Conduct + +As contributors and maintainers of the Jazzband projects, and in the interest of +fostering an open and welcoming community, we pledge to respect all people who +contribute through reporting issues, posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in the Jazzband a harassment-free experience +for everyone, regardless of the level of experience, gender, gender identity and +expression, sexual orientation, disability, personal appearance, body size, race, +ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery +- Personal attacks +- Trolling or insulting/derogatory comments +- Public or private harassment +- Publishing other's private information, such as physical or electronic addresses, + without explicit permission +- Other unethical or unprofessional conduct + +The Jazzband roadies have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are not +aligned to this Code of Conduct, or to ban temporarily or permanently any contributor +for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +By adopting this Code of Conduct, the roadies commit themselves to fairly and +consistently applying these principles to every aspect of managing the jazzband +projects. Roadies who do not follow or enforce the Code of Conduct may be permanently +removed from the Jazzband roadies. + +This code of conduct applies both within project spaces and in public spaces when an +individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by +contacting the roadies at `roadies@jazzband.co`. All complaints will be reviewed and +investigated and will result in a response that is deemed necessary and appropriate to +the circumstances. Roadies are obligated to maintain confidentiality with regard to the +reporter of an incident. + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version +1.3.0, available at [https://contributor-covenant.org/version/1/3/0/][version] + +[homepage]: https://contributor-covenant.org +[version]: https://contributor-covenant.org/version/1/3/0/ From fa026af595e55da32acedb28390c9e7d4ba2f5ae Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 25 Oct 2021 08:29:53 -0400 Subject: [PATCH 14/26] Add a pre-commit configuration --- .pre-commit-config.yaml | 1 + MANIFEST.in | 1 + 2 files changed, 2 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..4e6a92c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1 @@ +repos: [] diff --git a/MANIFEST.in b/MANIFEST.in index 4f06150..9b4420f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,3 +6,4 @@ recursive-include tests * recursive-include docs * recursive-include test_project * include LICENSE +include .pre-commit-config.yaml From 12e033ed1e424ca57dd7c75e22410f2defe6e90c Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 25 Oct 2021 08:57:16 -0400 Subject: [PATCH 15/26] Add CODE_OF_CONDUCT.md to the sdist --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 9b4420f..c13d839 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,3 +7,4 @@ recursive-include docs * recursive-include test_project * include LICENSE include .pre-commit-config.yaml +include CODE_OF_CONDUCT.md From 7e4b425ea31b53331c9ef3945893bc503494d381 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 25 Oct 2021 09:02:06 -0400 Subject: [PATCH 16/26] Don't run duplicate CI tasks on every PR The "pull_request" action already runs on pushes to any branch with an open PR, so only run the "push" action on the "master" branch. --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 755bc27..8a8e8d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,10 @@ name: Test -on: [push, pull_request] +on: + pull_request: + push: + branches: + - master jobs: build: From 09dfa471e0dbc81bfff7780a471156a4e7949d4c Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 25 Oct 2021 09:12:15 -0400 Subject: [PATCH 17/26] Sort MANIFEST.in --- MANIFEST.in | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index c13d839..3757d2b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,10 +1,10 @@ -include README.rst -include CONTRIBUTING.md +include .pre-commit-config.yaml include AUTHORS +include CODE_OF_CONDUCT.md +include CONTRIBUTING.md +include LICENSE +include README.rst include tox.ini -recursive-include tests * recursive-include docs * recursive-include test_project * -include LICENSE -include .pre-commit-config.yaml -include CODE_OF_CONDUCT.md +recursive-include tests * From 3ac97e539f377b2eff15dd270b8386c8ede20085 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Tue, 31 Aug 2021 21:46:38 -0400 Subject: [PATCH 18/26] Require Django as an install_requires Since "import django" occurs in the code, it is an explicit requirement. --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ebaa589..5590ea9 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,10 @@ setup( 'django-cadmin = configurations.management:execute_from_command_line', ], }, - install_requires=["setuptools"], + install_requires=[ + 'django>=2.2', + 'setuptools', + ], extras_require={ 'cache': ['django-cache-url'], 'database': ['dj-database-url'], From 7c9ac5e53f728a8c7cd7a00c471d68de17e40e5f Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 25 Oct 2021 09:34:42 -0400 Subject: [PATCH 19/26] Suppress import ordering style error --- configurations/asgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configurations/asgi.py b/configurations/asgi.py index 7a28d29..da9401b 100644 --- a/configurations/asgi.py +++ b/configurations/asgi.py @@ -2,7 +2,7 @@ from . import importer importer.install() -from django.core.asgi import get_asgi_application +from django.core.asgi import get_asgi_application # noqa: E402 # this is just for the crazy ones application = get_asgi_application() From 91ef9fd8adc49d4d3863cf3582241c53dc9313ab Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 25 Oct 2021 09:50:51 -0400 Subject: [PATCH 20/26] Fix a double space typo in a string --- configurations/values.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configurations/values.py b/configurations/values.py index 2413a1a..8eb3bbc 100644 --- a/configurations/values.py +++ b/configurations/values.py @@ -397,7 +397,7 @@ class PathValue(Value): value = super().setup(name) value = os.path.expanduser(value) if self.check_exists and not os.path.exists(value): - raise ValueError('Path {0!r} does not exist.'.format(value)) + raise ValueError('Path {0!r} does not exist.'.format(value)) return os.path.abspath(value) From ec1282887765b5d3f0c48f08e18d33d6aa1f8c0e Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 25 Oct 2021 09:52:21 -0400 Subject: [PATCH 21/26] Simplify import of django.core.wsgi.get_wsgi_application This has been available since Django 1.4. The import guard is no longer necessary. --- configurations/wsgi.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/configurations/wsgi.py b/configurations/wsgi.py index 54ab753..ea157a3 100644 --- a/configurations/wsgi.py +++ b/configurations/wsgi.py @@ -2,13 +2,7 @@ from . import importer importer.install() -try: - from django.core.wsgi import get_wsgi_application -except ImportError: # pragma: no cover - from django.core.handlers.wsgi import WSGIHandler - - def get_wsgi_application(): # noqa - return WSGIHandler() +from django.core.wsgi import get_wsgi_application # noqa: E402 # this is just for the crazy ones application = get_wsgi_application() From 40bdab3f4ad3324a079e6bbeb1f1efee1469fede Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Tue, 31 Aug 2021 21:42:20 -0400 Subject: [PATCH 22/26] Preserve Django warnings when DEFAULT_AUTO_FIELD is not set Fixes #286. --- configurations/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configurations/base.py b/configurations/base.py index 24de460..e54fcb4 100644 --- a/configurations/base.py +++ b/configurations/base.py @@ -38,6 +38,11 @@ class ConfigurationBase(type): # transitional setting # https://docs.djangoproject.com/en/3.1/releases/3.1/#default-hashing-algorithm-settings "DEFAULT_HASHING_ALGORITHM", + # When DEFAULT_AUTO_FIELD is not explicitly set, Django's emits a + # system check warning models.W042. This warning should not be + # suppressed, as downstream users are expected to make a decision. + # https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys + "DEFAULT_AUTO_FIELD", } # PASSWORD_RESET_TIMEOUT_DAYS is deprecated in favor of # PASSWORD_RESET_TIMEOUT in Django 3.1 From 6da8420635f968a028cf5d7523c981e3c2f32896 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Tue, 31 Aug 2021 22:07:33 -0400 Subject: [PATCH 23/26] Prevent warnings for settings deprecated in Django 2.2 Fixes #233. --- configurations/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configurations/base.py b/configurations/base.py index e54fcb4..a09af41 100644 --- a/configurations/base.py +++ b/configurations/base.py @@ -38,6 +38,10 @@ class ConfigurationBase(type): # transitional setting # https://docs.djangoproject.com/en/3.1/releases/3.1/#default-hashing-algorithm-settings "DEFAULT_HASHING_ALGORITHM", + # DEFAULT_CONTENT_TYPE and FILE_CHARSET are deprecated in + # Django 2.2 and are removed in Django 3.0 + "DEFAULT_CONTENT_TYPE", + "FILE_CHARSET", # When DEFAULT_AUTO_FIELD is not explicitly set, Django's emits a # system check warning models.W042. This warning should not be # suppressed, as downstream users are expected to make a decision. From df967f4d76bfd760381ea56ca587de944bbfe6a2 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 25 Oct 2021 11:21:06 -0400 Subject: [PATCH 24/26] Remove an obsolete command used for testing The test using this was removed in a04560993468e427e608ee1a848b43d7b6b80756. --- tests/management/__init__.py | 0 tests/management/commands/__init__.py | 0 .../management/commands/old_optparse_command.py | 16 ---------------- 3 files changed, 16 deletions(-) delete mode 100644 tests/management/__init__.py delete mode 100644 tests/management/commands/__init__.py delete mode 100644 tests/management/commands/old_optparse_command.py diff --git a/tests/management/__init__.py b/tests/management/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/management/commands/__init__.py b/tests/management/commands/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/management/commands/old_optparse_command.py b/tests/management/commands/old_optparse_command.py deleted file mode 100644 index d7844e5..0000000 --- a/tests/management/commands/old_optparse_command.py +++ /dev/null @@ -1,16 +0,0 @@ -from optparse import make_option -from django.core.management.base import BaseCommand - - -class Command(BaseCommand): - - # Used by a specific test to see how unupgraded - # management commands play with configurations. - # See the test code for more details. - - option_list = BaseCommand.option_list + ( - make_option('--arg1', action='store_true'), - ) - - def handle(self, *args, **options): - pass From b75c8d7a7ab066693271cde9e1c07503c2013081 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 25 Oct 2021 12:18:19 -0400 Subject: [PATCH 25/26] Remove references to TEMPLATE_DEBUG This setting is deprecated since Django 1.8. --- docs/patterns.rst | 1 - docs/values.rst | 1 - test_project/test_project/settings.py | 1 - 3 files changed, 3 deletions(-) diff --git a/docs/patterns.rst b/docs/patterns.rst index d2070b8..eff644a 100644 --- a/docs/patterns.rst +++ b/docs/patterns.rst @@ -21,7 +21,6 @@ file: class Dev(Base): DEBUG = True - TEMPLATE_DEBUG = DEBUG class Prod(Base): TIME_ZONE = 'America/New_York' diff --git a/docs/values.rst b/docs/values.rst index b0a5fe5..380bb04 100644 --- a/docs/values.rst +++ b/docs/values.rst @@ -46,7 +46,6 @@ value: class Dev(Configuration): DEBUG = values.BooleanValue(True) - TEMPLATE_DEBUG = values.BooleanValue(DEBUG) See the list of :ref:`built-in value classes` for more information. diff --git a/test_project/test_project/settings.py b/test_project/test_project/settings.py index 5d89812..879a3b8 100644 --- a/test_project/test_project/settings.py +++ b/test_project/test_project/settings.py @@ -5,7 +5,6 @@ class Base(Configuration): # Django settings for test_project project. DEBUG = values.BooleanValue(True, environ=True) - TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), From d373c9ab757b18431e30957d3a899870524ce5e2 Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Mon, 25 Oct 2021 13:05:36 -0400 Subject: [PATCH 26/26] Remove "mock" as a test requirement This is included in the standard library of Python 3.3+. --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index f311665..a77b6d8 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,6 @@ setup( 'email': ['dj-email-url'], 'search': ['dj-search-url'], 'testing': [ - 'mock', 'django-cache-url>=1.0.0', 'dj-database-url', 'dj-email-url',