Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-django-environ for
openSUSE:Factory checked in at 2026-02-17 16:47:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-environ (Old)
and /work/SRC/openSUSE:Factory/.python-django-environ.new.1977 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-environ"
Tue Feb 17 16:47:16 2026 rev:8 rq:1333394 version:0.12.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-django-environ/python-django-environ.changes
2025-02-24 15:51:16.141529137 +0100
+++
/work/SRC/openSUSE:Factory/.python-django-environ.new.1977/python-django-environ.changes
2026-02-17 16:47:59.393044140 +0100
@@ -1,0 +2,10 @@
+Mon Feb 16 16:46:27 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 0.12.1:
+ * Fixed PostgreSQL cluster URL parsing with bracketed IPv6
+ hosts in recent Python versions, preventing failures in
+ runtime URL parsing and related regression tests #574.
+ * Fixed debug logging in Env.get_value() to avoid evaluating
+ lazy default objects when DEBUG logging is enabled #571.
+
+-------------------------------------------------------------------
Old:
----
django_environ-0.12.0.tar.gz
New:
----
django_environ-0.12.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-django-environ.spec ++++++
--- /var/tmp/diff_new_pack.oM1bFu/_old 2026-02-17 16:48:01.869147608 +0100
+++ /var/tmp/diff_new_pack.oM1bFu/_new 2026-02-17 16:48:01.881148110 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-django-environ
#
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-django-environ
-Version: 0.12.0
+Version: 0.12.1
Release: 0
Summary: Django application configuration via environment variables
License: MIT
++++++ django_environ-0.12.0.tar.gz -> django_environ-0.12.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/.github/workflows/build.yml
new/django_environ-0.12.1/.github/workflows/build.yml
--- old/django_environ-0.12.0/.github/workflows/build.yml 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/.github/workflows/build.yml 2026-02-14
01:37:35.000000000 +0100
@@ -34,7 +34,7 @@
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- pip install tox tox-gh-actions setuptools
+ pip install tox tox-gh-actions build
- name: Check MANIFEST.in for completeness
run: tox -e manifest
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/.readthedocs.yml
new/django_environ-0.12.1/.readthedocs.yml
--- old/django_environ-0.12.0/.readthedocs.yml 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/.readthedocs.yml 2026-02-14 01:37:35.000000000
+0100
@@ -25,3 +25,6 @@
path: .
extra_requirements:
- docs
+
+sphinx:
+ configuration: docs/conf.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/BACKERS.rst
new/django_environ-0.12.1/BACKERS.rst
--- old/django_environ-0.12.0/BACKERS.rst 2023-08-30 14:48:23.000000000
+0200
+++ new/django_environ-0.12.1/BACKERS.rst 2026-02-14 01:37:35.000000000
+0100
@@ -23,7 +23,7 @@
.. |ocsponsor0| image::
https://opencollective.com/django-environ/sponsor/0/avatar.svg
:target: https://opencollective.com/triplebyte
:alt: Sponsor
-.. |ocsponsor1| image::
https://images.opencollective.com/static/images/become_sponsor.svg
+.. |ocsponsor1| image::
https://opencollective.com/static/images/become_sponsor.svg
:target:
https://opencollective.com/django-environ/contribute/sponsors-3474/checkout
:alt: Become a Sponsor
.. |ocbackerimage| image::
https://opencollective.com/django-environ/backers.svg?width=890
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/CHANGELOG.rst
new/django_environ-0.12.1/CHANGELOG.rst
--- old/django_environ-0.12.0/CHANGELOG.rst 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/CHANGELOG.rst 2026-02-14 01:37:35.000000000
+0100
@@ -5,6 +5,19 @@
The format is inspired by `Keep a Changelog
<https://keepachangelog.com/en/1.0.0/>`_
and this project adheres to `Semantic Versioning
<https://semver.org/spec/v2.0.0.html>`_.
+`v0.12.1`_ - 13-February-2026
+-----------------------------
+Fixed
++++++
+- Fixed PostgreSQL cluster URL parsing with bracketed IPv6 hosts in recent
+ Python versions, preventing failures in runtime URL parsing and related
+ regression tests
+ `#574 <https://github.com/joke2k/django-environ/issues/574>`_.
+- Fixed debug logging in ``Env.get_value()`` to avoid evaluating lazy default
+ objects when DEBUG logging is enabled
+ `#571 <https://github.com/joke2k/django-environ/issues/571>`_.
+
+
`v0.12.0`_ - 8-November-2024
-----------------------------
Fixed
@@ -421,6 +434,7 @@
- Initial release.
+.. _v0.12.1: https://github.com/joke2k/django-environ/compare/v0.12.0...v0.12.1
.. _v0.12.0: https://github.com/joke2k/django-environ/compare/v0.11.2...v0.12.0
.. _v0.11.2: https://github.com/joke2k/django-environ/compare/v0.11.1...v0.11.2
.. _v0.11.1: https://github.com/joke2k/django-environ/compare/v0.11.0...v0.11.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/LICENSE.txt
new/django_environ-0.12.1/LICENSE.txt
--- old/django_environ-0.12.0/LICENSE.txt 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/LICENSE.txt 2026-02-14 01:37:35.000000000
+0100
@@ -1,3 +1,4 @@
+Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/MANIFEST.in
new/django_environ-0.12.1/MANIFEST.in
--- old/django_environ-0.12.0/MANIFEST.in 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/MANIFEST.in 2026-02-14 01:37:35.000000000
+0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/PKG-INFO
new/django_environ-0.12.1/PKG-INFO
--- old/django_environ-0.12.0/PKG-INFO 2025-01-13 17:20:01.932052600 +0100
+++ new/django_environ-0.12.1/PKG-INFO 2026-02-14 01:49:57.984252500 +0100
@@ -1,12 +1,12 @@
-Metadata-Version: 2.2
+Metadata-Version: 2.4
Name: django-environ
-Version: 0.12.0
+Version: 0.12.1
Summary: A package that allows you to utilize 12factor inspired environment
variables to configure your Django application.
Home-page: https://django-environ.readthedocs.org
Author: Daniele Faraglia
Author-email: [email protected]
-Maintainer: Serghei Iakovlev
-Maintainer-email: [email protected]
+Maintainer: Daniele Faraglia
+Maintainer-email: [email protected]
License: MIT
Project-URL: Documentation, https://django-environ.readthedocs.org
Project-URL: Funding, https://opencollective.com/django-environ
@@ -69,6 +69,7 @@
Dynamic: home-page
Dynamic: keywords
Dynamic: license
+Dynamic: license-file
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: platform
@@ -154,7 +155,7 @@
method, to avoid to overwrite the real environ.
A similar approach is used in
`Two Scoops of Django
<https://web.archive.org/web/20240121133956/https://www.feldroy.com/books/two-scoops-of-django-3-x>`_
-book and explained in `12factor-django
<https://wellfire.co/learn/easier-12-factor-django>`_
+book and explained in `12factor-django
<https://dev.to/ale_jacques/django-drf-12-factor-app-with-examples-36jg>`_
article.
@@ -280,37 +281,17 @@
Release Information
===================
-v0.12.0 - 8-November-2024
+v0.12.1 - 13-February-2026
-----------------------------
Fixed
+++++
-- Include prefix in the ``ImproperlyConfigured`` error message
- `#513 <https://github.com/joke2k/django-environ/issues/513>`_.
-
-Added
-+++++
-- Add support for Python 3.12 and 3.13
- `#538 <https://github.com/joke2k/django-environ/issues/538>`_.
-- Add support for Django 5.1
- `#535 <https://github.com/joke2k/django-environ/issues/535>`_.
-- Add support for Django CockroachDB driver
- `#509 <https://github.com/joke2k/django-environ/issues/509>`_.
-- Add support for Django Channels
- `#266 <https://github.com/joke2k/django-environ/issues/266>`_.
-
-Changed
-+++++++
-- Disabled inline comments handling by default due to potential side effects.
- While the feature itself is useful, the project's philosophy dictates that
- it should not be enabled by default for all users
- `#499 <https://github.com/joke2k/django-environ/issues/499>`_.
-
-Removed
-+++++++
-- Removed support of Python 3.6, 3.7 and 3.8
- `#538 <https://github.com/joke2k/django-environ/issues/538>`_.
-- Removed support of Django 1.x.
- `#538 <https://github.com/joke2k/django-environ/issues/538>`_.
+- Fixed PostgreSQL cluster URL parsing with bracketed IPv6 hosts in recent
+ Python versions, preventing failures in runtime URL parsing and related
+ regression tests
+ `#574 <https://github.com/joke2k/django-environ/issues/574>`_.
+- Fixed debug logging in ``Env.get_value()`` to avoid evaluating lazy default
+ objects when DEBUG logging is enabled
+ `#571 <https://github.com/joke2k/django-environ/issues/571>`_.
`Full changelog
<https://django-environ.readthedocs.org/en/latest/changelog.html>`_.
@@ -322,7 +303,7 @@
-------------------------
If you discover a security vulnerability within ``django-environ``, please
-send an e-mail to Serghei Iakovlev via [email protected]. All security
+send an e-mail to Daniele Faraglia via [email protected]. All
security
vulnerabilities will be promptly addressed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/README.rst
new/django_environ-0.12.1/README.rst
--- old/django_environ-0.12.0/README.rst 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/README.rst 2026-02-14 01:37:35.000000000
+0100
@@ -99,7 +99,7 @@
method, to avoid to overwrite the real environ.
A similar approach is used in
`Two Scoops of Django
<https://web.archive.org/web/20240121133956/https://www.feldroy.com/books/two-scoops-of-django-3-x>`_
-book and explained in `12factor-django
<https://wellfire.co/learn/easier-12-factor-django>`_
+book and explained in `12factor-django
<https://dev.to/ale_jacques/django-drf-12-factor-app-with-examples-36jg>`_
article.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/SECURITY.rst
new/django_environ-0.12.1/SECURITY.rst
--- old/django_environ-0.12.0/SECURITY.rst 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/SECURITY.rst 2026-02-14 01:44:50.000000000
+0100
@@ -6,5 +6,5 @@
-------------------------
If you discover a security vulnerability within ``django-environ``, please
-send an e-mail to Serghei Iakovlev via [email protected]. All security
+send an e-mail to Daniele Faraglia via [email protected]. All
security
vulnerabilities will be promptly addressed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/django_environ-0.12.0/django_environ.egg-info/PKG-INFO
new/django_environ-0.12.1/django_environ.egg-info/PKG-INFO
--- old/django_environ-0.12.0/django_environ.egg-info/PKG-INFO 2025-01-13
17:20:01.000000000 +0100
+++ new/django_environ-0.12.1/django_environ.egg-info/PKG-INFO 2026-02-14
01:49:57.000000000 +0100
@@ -1,12 +1,12 @@
-Metadata-Version: 2.2
+Metadata-Version: 2.4
Name: django-environ
-Version: 0.12.0
+Version: 0.12.1
Summary: A package that allows you to utilize 12factor inspired environment
variables to configure your Django application.
Home-page: https://django-environ.readthedocs.org
Author: Daniele Faraglia
Author-email: [email protected]
-Maintainer: Serghei Iakovlev
-Maintainer-email: [email protected]
+Maintainer: Daniele Faraglia
+Maintainer-email: [email protected]
License: MIT
Project-URL: Documentation, https://django-environ.readthedocs.org
Project-URL: Funding, https://opencollective.com/django-environ
@@ -69,6 +69,7 @@
Dynamic: home-page
Dynamic: keywords
Dynamic: license
+Dynamic: license-file
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: platform
@@ -154,7 +155,7 @@
method, to avoid to overwrite the real environ.
A similar approach is used in
`Two Scoops of Django
<https://web.archive.org/web/20240121133956/https://www.feldroy.com/books/two-scoops-of-django-3-x>`_
-book and explained in `12factor-django
<https://wellfire.co/learn/easier-12-factor-django>`_
+book and explained in `12factor-django
<https://dev.to/ale_jacques/django-drf-12-factor-app-with-examples-36jg>`_
article.
@@ -280,37 +281,17 @@
Release Information
===================
-v0.12.0 - 8-November-2024
+v0.12.1 - 13-February-2026
-----------------------------
Fixed
+++++
-- Include prefix in the ``ImproperlyConfigured`` error message
- `#513 <https://github.com/joke2k/django-environ/issues/513>`_.
-
-Added
-+++++
-- Add support for Python 3.12 and 3.13
- `#538 <https://github.com/joke2k/django-environ/issues/538>`_.
-- Add support for Django 5.1
- `#535 <https://github.com/joke2k/django-environ/issues/535>`_.
-- Add support for Django CockroachDB driver
- `#509 <https://github.com/joke2k/django-environ/issues/509>`_.
-- Add support for Django Channels
- `#266 <https://github.com/joke2k/django-environ/issues/266>`_.
-
-Changed
-+++++++
-- Disabled inline comments handling by default due to potential side effects.
- While the feature itself is useful, the project's philosophy dictates that
- it should not be enabled by default for all users
- `#499 <https://github.com/joke2k/django-environ/issues/499>`_.
-
-Removed
-+++++++
-- Removed support of Python 3.6, 3.7 and 3.8
- `#538 <https://github.com/joke2k/django-environ/issues/538>`_.
-- Removed support of Django 1.x.
- `#538 <https://github.com/joke2k/django-environ/issues/538>`_.
+- Fixed PostgreSQL cluster URL parsing with bracketed IPv6 hosts in recent
+ Python versions, preventing failures in runtime URL parsing and related
+ regression tests
+ `#574 <https://github.com/joke2k/django-environ/issues/574>`_.
+- Fixed debug logging in ``Env.get_value()`` to avoid evaluating lazy default
+ objects when DEBUG logging is enabled
+ `#571 <https://github.com/joke2k/django-environ/issues/571>`_.
`Full changelog
<https://django-environ.readthedocs.org/en/latest/changelog.html>`_.
@@ -322,7 +303,7 @@
-------------------------
If you discover a security vulnerability within ``django-environ``, please
-send an e-mail to Serghei Iakovlev via [email protected]. All security
+send an e-mail to Daniele Faraglia via [email protected]. All
security
vulnerabilities will be promptly addressed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/docs/Makefile
new/django_environ-0.12.1/docs/Makefile
--- old/django_environ-0.12.0/docs/Makefile 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/docs/Makefile 2026-02-14 01:37:35.000000000
+0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/docs/conf.py
new/django_environ-0.12.1/docs/conf.py
--- old/django_environ-0.12.0/docs/conf.py 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/docs/conf.py 2026-02-14 01:37:35.000000000
+0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
@@ -116,6 +117,7 @@
# Do not check links to compare tags.
r"https://github.com/joke2k/django-environ/compare/.*",
]
+linkcheck_timeout = 60
#
# -- Options for nitpick -----------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/docs/docutils.conf
new/django_environ-0.12.1/docs/docutils.conf
--- old/django_environ-0.12.0/docs/docutils.conf 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/docs/docutils.conf 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/docs/tips.rst
new/django_environ-0.12.1/docs/tips.rst
--- old/django_environ-0.12.0/docs/tips.rst 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/docs/tips.rst 2026-02-14 01:37:35.000000000
+0100
@@ -290,7 +290,7 @@
Proxy value
===========
-Values that being with a ``$`` may be interpolated. Pass ``interpolate=True``
to
+Values that begin with a ``$`` may be interpolated. Pass ``interpolate=True``
to
``environ.Env()`` to enable this feature:
.. code-block:: python
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/environ/__init__.py
new/django_environ-0.12.1/environ/__init__.py
--- old/django_environ-0.12.0/environ/__init__.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/environ/__init__.py 2026-02-14
01:48:41.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
@@ -18,10 +19,10 @@
from .environ import *
-__copyright__ = 'Copyright (C) 2013-2023 Daniele Faraglia'
+__copyright__ = 'Copyright (C) 2013-2026 Daniele Faraglia'
"""The copyright notice of the package."""
-__version__ = '0.12.0'
+__version__ = '0.12.1'
"""The version of the package."""
__license__ = 'MIT'
@@ -33,10 +34,10 @@
__author_email__ = '[email protected]'
"""The email of the author of the package."""
-__maintainer__ = 'Serghei Iakovlev'
+__maintainer__ = 'Daniele Faraglia'
"""The maintainer of the package."""
-__maintainer_email__ = '[email protected]'
+__maintainer_email__ = '[email protected]'
"""The email of the maintainer of the package."""
__url__ = 'https://django-environ.readthedocs.org'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/environ/compat.py
new/django_environ-0.12.1/environ/compat.py
--- old/django_environ-0.12.0/environ/compat.py 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/environ/compat.py 2026-02-14 01:37:35.000000000
+0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/environ/environ.py
new/django_environ-0.12.1/environ/environ.py
--- old/django_environ-0.12.0/environ/environ.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/environ/environ.py 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
@@ -37,7 +38,7 @@
)
from .fileaware_mapping import FileAwareMapping
-Openable = (str, os.PathLike)
+OPENABLE = (str, os.PathLike)
logger = logging.getLogger(__name__)
@@ -380,8 +381,8 @@
"""
logger.debug(
- "get '%s' casted as '%s' with default '%s'",
- var, cast, default)
+ "get %r casted as %r with default type %s",
+ var, cast, type(default).__name__)
var_name = f'{self.prefix}{var}'
if var_name in self.scheme:
@@ -566,16 +567,25 @@
path += f':{url.port}'
user_host = url.netloc.rsplit('@', 1)
- if url.scheme in cls.POSTGRES_FAMILY and ',' in user_host[-1]:
+ db_netloc = unquote(user_host[-1])
+ if url.scheme in cls.POSTGRES_FAMILY and ',' in db_netloc:
# Parsing postgres cluster dsn
- hinfo = list(
- itertools.zip_longest(
- *(
- host.rsplit(':', 1)
- for host in user_host[-1].split(',')
- )
- )
- )
+ host_parts = []
+ for host in db_netloc.split(','):
+ if host.startswith('['):
+ end = host.find(']')
+ if end != -1 and host[end + 1:end + 2] == ':':
+ host_parts.append((host[:end + 1], host[end + 2:]))
+ else:
+ host_parts.append((host, ''))
+ else:
+ hparts = host.rsplit(':', 1)
+ if len(hparts) == 2 and hparts[1].isdigit():
+ host_parts.append(tuple(hparts))
+ else:
+ host_parts.append((host, ''))
+
+ hinfo = list(itertools.zip_longest(*host_parts))
hostname = ','.join(hinfo[0])
port = ','.join(filter(None, hinfo[1])) if len(hinfo) == 2 else ''
else:
@@ -922,10 +932,6 @@
by the file content. ``overwrite=True`` will force an overwrite of
existing environment variables.
- Refs:
-
- * https://wellfire.co/learn/easier-12-factor-django
-
:param env_file: The path to the ``.env`` file your application should
use. If a path is not provided, `read_env` will attempt to import
the Django settings module from the Django project root.
@@ -952,7 +958,7 @@
return
try:
- if isinstance(env_file, Openable):
+ if isinstance(env_file, OPENABLE):
# Python 3.5 support (wrap path with str).
with open(str(env_file), encoding=encoding) as f:
content = f.read()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/environ/fileaware_mapping.py
new/django_environ-0.12.1/environ/fileaware_mapping.py
--- old/django_environ-0.12.0/environ/fileaware_mapping.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/environ/fileaware_mapping.py 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/setup.py
new/django_environ-0.12.1/setup.py
--- old/django_environ-0.12.0/setup.py 2025-01-13 16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/setup.py 2026-02-14 01:37:35.000000000 +0100
@@ -2,6 +2,7 @@
#
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/__init__.py
new/django_environ-0.12.1/tests/__init__.py
--- old/django_environ-0.12.0/tests/__init__.py 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/tests/__init__.py 2026-02-14 01:37:35.000000000
+0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/asserts.py
new/django_environ-0.12.1/tests/asserts.py
--- old/django_environ-0.12.0/tests/asserts.py 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/tests/asserts.py 2026-02-14 01:37:35.000000000
+0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/conftest.py
new/django_environ-0.12.1/tests/conftest.py
--- old/django_environ-0.12.0/tests/conftest.py 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/tests/conftest.py 2026-02-14 01:37:35.000000000
+0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/fixtures.py
new/django_environ-0.12.1/tests/fixtures.py
--- old/django_environ-0.12.0/tests/fixtures.py 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/tests/fixtures.py 2026-02-14 01:37:35.000000000
+0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/test_cache.py
new/django_environ-0.12.1/tests/test_cache.py
--- old/django_environ-0.12.0/tests/test_cache.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/tests/test_cache.py 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/test_channels.py
new/django_environ-0.12.1/tests/test_channels.py
--- old/django_environ-0.12.0/tests/test_channels.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/tests/test_channels.py 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
@@ -7,6 +8,8 @@
# the LICENSE.txt file that was distributed with this source code.
from environ import Env
+import pytest
+from environ.compat import ImproperlyConfigured
def test_channels_parsing():
@@ -23,3 +26,14 @@
result = Env.channels_url_config(url)
assert result["BACKEND"] == "channels_redis.pubsub.RedisPubSubChannelLayer"
assert result["CONFIG"]["hosts"][0] ==
"redis://user:password@localhost:6379/0"
+
+
+def test_channels_backend_override():
+ result = Env.channels_url_config("unsupported://",
backend="custom.backend")
+ assert result["BACKEND"] == "custom.backend"
+
+
+def test_channels_invalid_schema():
+ with pytest.raises(ImproperlyConfigured) as exc:
+ Env.channels_url_config("unsupported://")
+ assert 'Invalid channels schema unsupported' == str(exc.value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/test_db.py
new/django_environ-0.12.1/tests/test_db.py
--- old/django_environ-0.12.0/tests/test_db.py 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/tests/test_db.py 2026-02-14 01:37:35.000000000
+0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
@@ -224,6 +225,37 @@
assert url['PORT'] == ''
+def test_postgres_cluster_with_ipv6_parsing():
+ """Parse postgres cluster URLs containing bracketed IPv6 hosts."""
+ env_url = (
+ 'postgres://username:p@ss:12,wor:34d@'
+ 'host1:111,22.55.44.88:222,[2001:db8::1234]:333/db'
+ )
+
+ url = Env.db_url_config(env_url)
+
+ assert url['ENGINE'] == DJANGO_POSTGRES
+ assert url['NAME'] == 'db'
+ assert url['HOST'] == 'host1,22.55.44.88,[2001:db8::1234]'
+ assert url['USER'] == 'username'
+ assert url['PASSWORD'] == 'p@ss:12,wor:34d'
+ assert url['PORT'] == '111,222,333'
+
+
+def test_postgres_cluster_with_ipv6_without_port_parsing():
+ """Keep bracketed IPv6 hosts in cluster URLs even when port is omitted."""
+ env_url = 'postgres://user:pass@host1:111,[2001:db8::1234],host3:333/db'
+
+ url = Env.db_url_config(env_url)
+
+ assert url['ENGINE'] == DJANGO_POSTGRES
+ assert url['NAME'] == 'db'
+ assert url['HOST'] == 'host1,[2001:db8::1234],host3'
+ assert url['USER'] == 'user'
+ assert url['PASSWORD'] == 'pass'
+ assert url['PORT'] == '111,333'
+
+
@pytest.mark.parametrize(
'scheme',
['postgres', 'postgresql', 'psql', 'pgsql', 'postgis'],
@@ -267,6 +299,19 @@
assert url['NAME'] == ':memory:'
+def test_ldap_url_with_port():
+ """Keep LDAP host and include port in NAME when explicitly provided."""
+ env_url = 'ldap://cn=admin,dc=nodomain,dc=org:[email protected]:1234'
+ url = Env.db_url_config(env_url)
+
+ assert url['ENGINE'] == 'ldapdb.backends.ldap'
+ assert url['NAME'] == 'ldap://example.com:1234'
+ assert url['HOST'] == 'example.com'
+ assert url['USER'] == 'cn=admin,dc=nodomain,dc=org'
+ assert url['PASSWORD'] == 'secret'
+ assert url['PORT'] == 1234
+
+
def test_database_options_parsing():
url = 'postgres://user:pass@host:1234/dbname?conn_max_age=600'
url = Env.db_url_config(url)
@@ -285,3 +330,11 @@
assert url['OPTIONS'] == {
'init_command': 'SET storage_engine=INNODB',
}
+
+
+def test_unknown_engine_warns_and_returns_empty_dict(recwarn):
+ result = Env.db_url_config('localhost')
+
+ assert result == {}
+ assert len(recwarn) == 1
+ assert recwarn.pop(UserWarning)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/test_email.py
new/django_environ-0.12.1/tests/test_email.py
--- old/django_environ-0.12.0/tests/test_email.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/tests/test_email.py 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
@@ -7,6 +8,8 @@
# the LICENSE.txt file that was distributed with this source code.
from environ import Env
+from environ.compat import ImproperlyConfigured
+import pytest
def test_smtp_parsing():
@@ -32,3 +35,21 @@
url = Env.email_url_config(url, backend=backend)
assert url['EMAIL_BACKEND'] == backend
+
+
+def test_smtp_ssl_and_options_parsing():
+ url = (
+ "smtp+ssl://[email protected]:[email protected]:465"
+ "?EMAIL_USE_SSL=true&timeout=30"
+ )
+ url = Env.email_url_config(url)
+
+ assert url['EMAIL_BACKEND'] ==
'django.core.mail.backends.smtp.EmailBackend'
+ assert url['EMAIL_USE_SSL'] == 'true'
+ assert url['OPTIONS'] == {'TIMEOUT': 30}
+
+
+def test_invalid_email_schema():
+ with pytest.raises(ImproperlyConfigured) as exc:
+ Env.email_url_config('smtp3://user:[email protected]:25')
+ assert 'Invalid email schema smtp3' == str(exc.value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/test_env.py
new/django_environ-0.12.1/tests/test_env.py
--- old/django_environ-0.12.0/tests/test_env.py 2025-01-13 16:27:16.000000000
+0100
+++ new/django_environ-0.12.1/tests/test_env.py 2026-02-14 01:37:35.000000000
+0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
@@ -8,6 +9,8 @@
import os
import tempfile
+import logging
+import io
from urllib.parse import quote
import pytest
@@ -400,6 +403,23 @@
assert self.env.get_value('INT_VAR', default=1) == 42
assert self.env.get_value('FLOAT_VAR', default=1.2) == 33.3
+ def test_get_value_debug_log_does_not_eval_lazy_default(self, caplog):
+ class LazyDefault:
+ def __init__(self):
+ self.was_evaluated = False
+
+ def __str__(self):
+ self.was_evaluated = True
+ return 'lazy-default'
+
+ lazy_default = LazyDefault()
+
+ with caplog.at_level(logging.DEBUG, logger='environ.environ'):
+ value = self.env.get_value('MISSING_VAR', default=lazy_default)
+
+ assert value is lazy_default
+ assert not lazy_default.was_evaluated
+
def test_exported(self):
assert self.env('EXPORTED_VAR') == FakeEnv.EXPORTED
@@ -414,6 +434,37 @@
assert str(excinfo.value) == 'Set the PREFIX_not_present environment
variable'
assert excinfo.value.__cause__ is not None
+ def test_read_env_with_file_like_object(self):
+ env_cls = type(self.env)
+ env_cls.ENVIRON = {}
+ self.env.read_env(io.StringIO('FROM_FILELIKE=value\n'))
+ assert env_cls.ENVIRON['FROM_FILELIKE'] == 'value'
+
+ def test_read_env_without_path_logs_when_missing(self, monkeypatch,
caplog):
+ monkeypatch.setattr(os.path, 'exists', lambda *_: False)
+ with caplog.at_level(logging.INFO, logger='environ.environ'):
+ self.env.read_env()
+ assert any("doesn't exist" in message for message in caplog.messages)
+
+ def test_read_env_missing_file_logs_and_returns(self, caplog):
+ env_file = '/tmp/definitely-missing-django-environ.env'
+ with caplog.at_level(logging.INFO, logger='environ.environ'):
+ self.env.read_env(env_file)
+ assert any("not found - if you're not configuring your " in message
+ for message in caplog.messages)
+
+ def test_read_env_invalid_line_warns(self, caplog):
+ with tempfile.TemporaryDirectory() as temp_dir:
+ env_path = os.path.join(temp_dir, '.env')
+ with open(env_path, 'w') as file_handle:
+ file_handle.write('INVALID LINE\n')
+
+ with caplog.at_level(logging.WARNING, logger='environ.environ'):
+ self.env.read_env(env_path)
+
+ assert any('Invalid line: INVALID LINE' in message
+ for message in caplog.messages)
+
class TestFileEnv(TestEnv):
def setup_method(self, method):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/test_fileaware.py
new/django_environ-0.12.1/tests/test_fileaware.py
--- old/django_environ-0.12.0/tests/test_fileaware.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/tests/test_fileaware.py 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/test_path.py
new/django_environ-0.12.1/tests/test_path.py
--- old/django_environ-0.12.0/tests/test_path.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/tests/test_path.py 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/test_schema.py
new/django_environ-0.12.1/tests/test_schema.py
--- old/django_environ-0.12.0/tests/test_schema.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/tests/test_schema.py 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/test_search.py
new/django_environ-0.12.1/tests/test_search.py
--- old/django_environ-0.12.0/tests/test_search.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/tests/test_search.py 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tests/test_utils.py
new/django_environ-0.12.1/tests/test_utils.py
--- old/django_environ-0.12.0/tests/test_utils.py 2025-01-13
16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/tests/test_utils.py 2026-02-14
01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/django_environ-0.12.0/tox.ini
new/django_environ-0.12.1/tox.ini
--- old/django_environ-0.12.0/tox.ini 2025-01-13 16:27:16.000000000 +0100
+++ new/django_environ-0.12.1/tox.ini 2026-02-14 01:37:35.000000000 +0100
@@ -1,5 +1,6 @@
# This file is part of the django-environ.
#
+# Copyright (c) 2024-present, Daniele Faraglia <[email protected]>
# Copyright (c) 2021-2024, Serghei Iakovlev <[email protected]>
# Copyright (c) 2013-2021, Daniele Faraglia <[email protected]>
#