New Upstream Release - dj-database-url

Ready changes

Summary

Merged new upstream version: 1.2.0 (was: 0.5.0).

Resulting package

Built on 2022-12-14T16:18 (took 3m38s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-releases python3-dj-database-url

Lintian Result

Diff

diff --git a/LICENSE b/LICENSE
index 3a6119b..3aaf151 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,8 +1,27 @@
-Copyright (c) 2014, Kenneth Reitz
+Copyright (c) Kenneth Reitz & individual contributors
 All rights reserved.
 
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
 
-Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+    1. Redistributions of source code must retain the above copyright notice,
+       this list of conditions and the following disclaimer.
+
+    2. Redistributions in binary form must reproduce the above copyright
+       notice, this list of conditions and the following disclaimer in the
+       documentation and/or other materials provided with the distribution.
+
+    3. Neither the name of Django nor the names of its contributors may be used
+       to endorse or promote products derived from this software without
+       specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index 1aba38f..0000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1 +0,0 @@
-include LICENSE
diff --git a/PKG-INFO b/PKG-INFO
index 24e6d46..5d940c8 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,69 +1,16 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: dj-database-url
-Version: 0.5.0
+Version: 1.2.0
 Summary: Use Database URLs in your Django Application.
-Home-page: https://github.com/kennethreitz/dj-database-url
-Author: Kenneth Reitz
-Author-email: me@kennethreitz.com
+Home-page: https://github.com/jazzband/dj-database-url
+Author: Original Author: Kenneth Reitz, Maintained by: JazzBand Community
 License: BSD
-Description-Content-Type: UNKNOWN
-Description: 
-        dj-database-url
-        ~~~~~~~~~~~~~~~
-        
-        .. image:: https://secure.travis-ci.org/kennethreitz/dj-database-url.png?branch=master
-           :target: http://travis-ci.org/kennethreitz/dj-database-url
-        
-        This simple Django utility allows you to utilize the
-        `12factor <http://www.12factor.net/backing-services>`_ inspired
-        ``DATABASE_URL`` environment variable to configure your Django application.
-        
-        The ``dj_database_url.config`` method returns a Django database connection
-        dictionary, populated with all the data specified in your URL. There is
-        also a `conn_max_age` argument to easily enable Django's connection pool.
-        
-        If you'd rather not use an environment variable, you can pass a URL in directly
-        instead to ``dj_database_url.parse``.
-        
-        Supported Databases
-        -------------------
-        
-        Support currently exists for PostgreSQL, PostGIS, MySQL, MySQL (GIS),
-        Oracle, Oracle (GIS), and SQLite.
-        
-        Installation
-        ------------
-        
-        Installation is simple::
-        
-            $ pip install dj-database-url
-        
-        Usage
-        -----
-        
-        Configure your database in ``settings.py`` from ``DATABASE_URL``::
-        
-            import dj_database_url
-        
-            DATABASES['default'] = dj_database_url.config(conn_max_age=600, ssl_require=True)
-        
-        Provide a default::
-        
-            DATABASES['default'] = dj_database_url.config(default='postgres://...'}
-        
-        Parse an arbitrary Database URL::
-        
-            DATABASES['default'] = dj_database_url.parse('postgres://...', conn_max_age=600)
-        
-        The ``conn_max_age`` attribute is the lifetime of a database connection in seconds
-        and is available in Django 1.6+. If you do not set a value, it will default to ``0``
-        which is Django's historical behavior of using a new database connection on each
-        request. Use ``None`` for unlimited persistent connections.
-        
-        
-        
 Platform: any
 Classifier: Environment :: Web Environment
+Classifier: Framework :: Django
+Classifier: Framework :: Django :: 3.2
+Classifier: Framework :: Django :: 4.0
+Classifier: Framework :: Django :: 4.1
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: BSD License
 Classifier: Operating System :: OS Independent
@@ -71,9 +18,237 @@ Classifier: Programming Language :: Python
 Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
 Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Description-Content-Type: text/x-rst
+License-File: LICENSE
+
+DJ-Database-URL
+~~~~~~~~~~~~~~~
+
+.. image:: https://jazzband.co/static/img/badge.png
+   :target: https://jazzband.co/
+   :alt: Jazzband
+
+.. image:: https://github.com/jazzband/dj-database-url/actions/workflows/test.yml/badge.svg
+   :target: https://github.com/jazzband/dj-database-url/actions/workflows/test.yml
+
+.. image:: https://codecov.io/gh/jazzband/dj-database-url/branch/master/graph/badge.svg?token=7srBUpszOa
+   :target: https://codecov.io/gh/jazzband/dj-database-url
+
+This simple Django utility allows you to utilize the
+`12factor <http://www.12factor.net/backing-services>`_ inspired
+``DATABASE_URL`` environment variable to configure your Django application.
+
+The ``dj_database_url.config`` method returns a Django database connection
+dictionary, populated with all the data specified in your URL. There is
+also a `conn_max_age` argument to easily enable Django's connection pool.
+
+If you'd rather not use an environment variable, you can pass a URL in directly
+instead to ``dj_database_url.parse``.
+
+Supported Databases
+-------------------
+
+Support currently exists for PostgreSQL, PostGIS, MySQL, MySQL (GIS),
+Oracle, Oracle (GIS), Redshift, CockroachDB, Timescale, Timescale (GIS) and SQLite.
+
+Installation
+------------
+
+Installation is simple:
+
+.. code-block:: console
+
+    $ pip install dj-database-url
+
+Usage
+-----
+
+1. If ``DATABASES`` is already defined:
+
+- Configure your database in ``settings.py`` from ``DATABASE_URL``:
+
+  .. code-block:: python
+
+      import dj_database_url
+
+      DATABASES['default'] = dj_database_url.config(
+          conn_max_age=600,
+          conn_health_checks=True,
+      )
+
+- Provide a default:
+
+  .. code-block:: python
+
+      DATABASES['default'] = dj_database_url.config(
+          default='postgres://...',
+          conn_max_age=600,
+          conn_health_checks=True,
+      )
+
+- Parse an arbitrary Database URL:
+
+  .. code-block:: python
+
+      DATABASES['default'] = dj_database_url.parse(
+          'postgres://...',
+          conn_max_age=600,
+          conn_health_checks=True,
+      )
+
+2. If ``DATABASES`` is not defined:
+
+- Configure your database in ``settings.py`` from ``DATABASE_URL``:
+
+  .. code-block:: python
+
+      import dj_database_url
+
+      DATABASES = {
+          'default': dj_database_url.config(
+              conn_max_age=600,
+              conn_health_checks=True,
+          ),
+      }
+
+- You can provide a default, used if the ``DATABASE_URL`` setting is not defined:
+
+  .. code-block:: python
+
+      DATABASES = {
+          'default': dj_database_url.config(
+              default='postgres://...',
+              conn_max_age=600,
+              conn_health_checks=True,
+          )
+      }
+
+- Parse an arbitrary Database URL:
+
+  .. code-block:: python
+
+      DATABASES = {
+          'default': dj_database_url.parse(
+              'postgres://...',
+              conn_max_age=600,
+              conn_health_checks=True,
+          )
+      }
+
+``conn_max_age`` sets the |CONN_MAX_AGE setting|__, which tells Django to
+persist database connections between requests, up to the given lifetime in
+seconds. If you do not provide a value, it will follow Django’s default of
+``0``. Setting it is recommended for performance.
+
+.. |CONN_MAX_AGE setting| replace:: ``CONN_MAX_AGE`` setting
+__ https://docs.djangoproject.com/en/stable/ref/settings/#conn-max-age
+
+``conn_health_checks`` sets the |CONN_HEALTH_CHECKS setting|__ (new in Django
+4.1), which tells Django to check a persisted connection still works at the
+start of each request. If you do not provide a value, it will follow Django’s
+default of ``False``. Enabling it is recommended if you set a non-zero
+``conn_max_age``.
+
+.. |CONN_HEALTH_CHECKS setting| replace:: ``CONN_HEALTH_CHECKS`` setting
+__ https://docs.djangoproject.com/en/stable/ref/settings/#conn-health-checks
+
+Strings passed to `dj_database_url` must be valid URLs; in
+particular, special characters must be url-encoded. The following url will raise
+a `ValueError`:
+
+.. code-block:: plaintext
+
+    postgres://user:p#ssword!@localhost/foobar
+
+and should instead be passed as:
+
+.. code-block:: plaintext
+
+    postgres://user:p%23ssword!@localhost/foobar
+
+`TEST <https://docs.djangoproject.com/en/stable/ref/settings/#test>`_ settings can be configured using the ``test_options`` attribute::
+
+    DATABASES['default'] = dj_database_url.config(default='postgres://...', test_options={'NAME': 'mytestdatabase'})
+
+
+URL schema
+----------
+
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Engine               | Django Backend                                | URL                                              |
++======================+===============================================+==================================================+
+| PostgreSQL           | ``django.db.backends.postgresql`` [1]_        | ``postgres://USER:PASSWORD@HOST:PORT/NAME`` [2]_ |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| PostGIS              | ``django.contrib.gis.db.backends.postgis``    | ``postgis://USER:PASSWORD@HOST:PORT/NAME``       |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MSSQL                | ``sql_server.pyodbc``                         | ``mssql://USER:PASSWORD@HOST:PORT/NAME``         |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MSSQL [5]_           | ``mssql``                                     | ``mssqlms://USER:PASSWORD@HOST:PORT/NAME``       |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MySQL                | ``django.db.backends.mysql``                  | ``mysql://USER:PASSWORD@HOST:PORT/NAME`` [2]_    |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MySQL (GIS)          | ``django.contrib.gis.db.backends.mysql``      | ``mysqlgis://USER:PASSWORD@HOST:PORT/NAME``      |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| SQLite               | ``django.db.backends.sqlite3``                | ``sqlite:///PATH`` [3]_                          |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| SpatiaLite           | ``django.contrib.gis.db.backends.spatialite`` | ``spatialite:///PATH`` [3]_                      |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Oracle               | ``django.db.backends.oracle``                 | ``oracle://USER:PASSWORD@HOST:PORT/NAME`` [4]_   |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Oracle (GIS)         | ``django.contrib.gis.db.backends.oracle``     | ``oraclegis://USER:PASSWORD@HOST:PORT/NAME``     |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Redshift             | ``django_redshift_backend``                   | ``redshift://USER:PASSWORD@HOST:PORT/NAME``      |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| CockroachDB          | ``django_cockroachdb``                        | ``cockroach://USER:PASSWORD@HOST:PORT/NAME``     |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Timescale [6]_       | ``timescale.db.backends.postgresql``          | ``timescale://USER:PASSWORD@HOST:PORT/NAME``     |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Timescale (GIS) [6]_ | ``timescale.db.backend.postgis``              | ``timescalegis://USER:PASSWORD@HOST:PORT/NAME``  |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+
+.. [1] The django.db.backends.postgresql backend is named django.db.backends.postgresql_psycopg2 in older releases. For
+       backwards compatibility, the old name still works in newer versions. (The new name does not work in older versions).
+.. [2] With PostgreSQL or CloudSQL, you can also use unix domain socket paths with
+       `percent encoding <http://www.postgresql.org/docs/9.2/interactive/libpq-connect.html#AEN38162>`_:
+       ``postgres://%2Fvar%2Flib%2Fpostgresql/dbname``
+       ``mysql://uf07k1i6d8ia0v@%2fcloudsql%2fproject%3alocation%3ainstance/dbname``
+.. [3] SQLite connects to file based databases. The same URL format is used, omitting
+       the hostname, and using the "file" portion as the filename of the database.
+       This has the effect of four slashes being present for an absolute file path:
+       ``sqlite:////full/path/to/your/database/file.sqlite``.
+.. [4] Note that when connecting to Oracle the URL isn't in the form you may know
+       from using other Oracle tools (like SQLPlus) i.e. user and password are separated
+       by ``:`` not by ``/``. Also you can omit ``HOST`` and ``PORT``
+       and provide a full DSN string or TNS name in ``NAME`` part.
+.. [5] Microsoft official `mssql-django <https://github.com/microsoft/mssql-django>`_ adapter.
+.. [6] Using the django-timescaledb Package which must be installed.
+
+
+Contributing
+------------
+
+We welcome contributions to this project. Projects can take two forms:
+
+1. Raising issues or helping others through the github issue tracker.
+2. Contributing code.
+
+Raising Issues or helping others:
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When submitting an issue or helping other remember you are talking to humans who have feelings, jobs and lives of their
+own. Be nice, be kind, be polite. Remember english may not be someone first language, if you do not understand or
+something is not clear be polite and re-ask/ re-word.
+
+Contributing code:
+^^^^^^^^^^^^^^^^^^
+
+* Before writing code be sure to check existing PR's and issues in the tracker.
+* Write code to the pylint spec.
+* Large or wide sweeping changes will take longer, and may face more scrutiny than smaller confined changes.
+* Code should be pass `black` and `flake8` validation.
diff --git a/README.rst b/README.rst
index 687ed51..2938bcf 100644
--- a/README.rst
+++ b/README.rst
@@ -1,8 +1,15 @@
 DJ-Database-URL
 ~~~~~~~~~~~~~~~
 
-.. image:: https://secure.travis-ci.org/kennethreitz/dj-database-url.svg?branch=master
-   :target: http://travis-ci.org/kennethreitz/dj-database-url
+.. image:: https://jazzband.co/static/img/badge.png
+   :target: https://jazzband.co/
+   :alt: Jazzband
+
+.. image:: https://github.com/jazzband/dj-database-url/actions/workflows/test.yml/badge.svg
+   :target: https://github.com/jazzband/dj-database-url/actions/workflows/test.yml
+
+.. image:: https://codecov.io/gh/jazzband/dj-database-url/branch/master/graph/badge.svg?token=7srBUpszOa
+   :target: https://codecov.io/gh/jazzband/dj-database-url
 
 This simple Django utility allows you to utilize the
 `12factor <http://www.12factor.net/backing-services>`_ inspired
@@ -19,72 +26,200 @@ Supported Databases
 -------------------
 
 Support currently exists for PostgreSQL, PostGIS, MySQL, MySQL (GIS),
-Oracle, Oracle (GIS), Redshift, and SQLite.
+Oracle, Oracle (GIS), Redshift, CockroachDB, Timescale, Timescale (GIS) and SQLite.
 
 Installation
 ------------
 
-Installation is simple::
+Installation is simple:
+
+.. code-block:: console
 
     $ pip install dj-database-url
 
 Usage
 -----
 
-Configure your database in ``settings.py`` from ``DATABASE_URL``::
+1. If ``DATABASES`` is already defined:
+
+- Configure your database in ``settings.py`` from ``DATABASE_URL``:
+
+  .. code-block:: python
+
+      import dj_database_url
+
+      DATABASES['default'] = dj_database_url.config(
+          conn_max_age=600,
+          conn_health_checks=True,
+      )
+
+- Provide a default:
+
+  .. code-block:: python
+
+      DATABASES['default'] = dj_database_url.config(
+          default='postgres://...',
+          conn_max_age=600,
+          conn_health_checks=True,
+      )
+
+- Parse an arbitrary Database URL:
+
+  .. code-block:: python
+
+      DATABASES['default'] = dj_database_url.parse(
+          'postgres://...',
+          conn_max_age=600,
+          conn_health_checks=True,
+      )
+
+2. If ``DATABASES`` is not defined:
+
+- Configure your database in ``settings.py`` from ``DATABASE_URL``:
+
+  .. code-block:: python
+
+      import dj_database_url
+
+      DATABASES = {
+          'default': dj_database_url.config(
+              conn_max_age=600,
+              conn_health_checks=True,
+          ),
+      }
+
+- You can provide a default, used if the ``DATABASE_URL`` setting is not defined:
+
+  .. code-block:: python
 
-    import dj_database_url
+      DATABASES = {
+          'default': dj_database_url.config(
+              default='postgres://...',
+              conn_max_age=600,
+              conn_health_checks=True,
+          )
+      }
 
-    DATABASES['default'] = dj_database_url.config(conn_max_age=600)
+- Parse an arbitrary Database URL:
 
-Provide a default::
+  .. code-block:: python
 
-    DATABASES['default'] = dj_database_url.config(default='postgres://...')
+      DATABASES = {
+          'default': dj_database_url.parse(
+              'postgres://...',
+              conn_max_age=600,
+              conn_health_checks=True,
+          )
+      }
 
-Parse an arbitrary Database URL::
+``conn_max_age`` sets the |CONN_MAX_AGE setting|__, which tells Django to
+persist database connections between requests, up to the given lifetime in
+seconds. If you do not provide a value, it will follow Django’s default of
+``0``. Setting it is recommended for performance.
 
-    DATABASES['default'] = dj_database_url.parse('postgres://...', conn_max_age=600)
+.. |CONN_MAX_AGE setting| replace:: ``CONN_MAX_AGE`` setting
+__ https://docs.djangoproject.com/en/stable/ref/settings/#conn-max-age
+
+``conn_health_checks`` sets the |CONN_HEALTH_CHECKS setting|__ (new in Django
+4.1), which tells Django to check a persisted connection still works at the
+start of each request. If you do not provide a value, it will follow Django’s
+default of ``False``. Enabling it is recommended if you set a non-zero
+``conn_max_age``.
+
+.. |CONN_HEALTH_CHECKS setting| replace:: ``CONN_HEALTH_CHECKS`` setting
+__ https://docs.djangoproject.com/en/stable/ref/settings/#conn-health-checks
+
+Strings passed to `dj_database_url` must be valid URLs; in
+particular, special characters must be url-encoded. The following url will raise
+a `ValueError`:
+
+.. code-block:: plaintext
+
+    postgres://user:p#ssword!@localhost/foobar
+
+and should instead be passed as:
+
+.. code-block:: plaintext
+
+    postgres://user:p%23ssword!@localhost/foobar
+
+`TEST <https://docs.djangoproject.com/en/stable/ref/settings/#test>`_ settings can be configured using the ``test_options`` attribute::
+
+    DATABASES['default'] = dj_database_url.config(default='postgres://...', test_options={'NAME': 'mytestdatabase'})
 
-The ``conn_max_age`` attribute is the lifetime of a database connection in seconds
-and is available in Django 1.6+. If you do not set a value, it will default to ``0``
-which is Django's historical behavior of using a new database connection on each
-request. Use ``None`` for unlimited persistent connections.
 
 URL schema
 ----------
 
-+-------------+-----------------------------------------------+--------------------------------------------------+
-| Engine      | Django Backend                                | URL                                              |
-+=============+===============================================+==================================================+
-| PostgreSQL  | ``django.db.backends.postgresql_psycopg2``    | ``postgres://USER:PASSWORD@HOST:PORT/NAME`` [1]_ |
-+-------------+-----------------------------------------------+--------------------------------------------------+
-| PostGIS     | ``django.contrib.gis.db.backends.postgis``    | ``postgis://USER:PASSWORD@HOST:PORT/NAME``       |
-+-------------+-----------------------------------------------+--------------------------------------------------+
-| MSSQL       | ``sql_server.pyodbc``                         | ``mssql://USER:PASSWORD@HOST:PORT/NAME``         |
-+-------------+-----------------------------------------------+--------------------------------------------------+
-| MySQL       | ``django.db.backends.mysql``                  | ``mysql://USER:PASSWORD@HOST:PORT/NAME``         |
-+-------------+-----------------------------------------------+--------------------------------------------------+
-| MySQL (GIS) | ``django.contrib.gis.db.backends.mysql``      | ``mysqlgis://USER:PASSWORD@HOST:PORT/NAME``      |
-+-------------+-----------------------------------------------+--------------------------------------------------+
-| SQLite      | ``django.db.backends.sqlite3``                | ``sqlite:///PATH`` [2]_                          |
-+-------------+-----------------------------------------------+--------------------------------------------------+
-| SpatiaLite  | ``django.contrib.gis.db.backends.spatialite`` | ``spatialite:///PATH`` [2]_                      |
-+-------------+-----------------------------------------------+--------------------------------------------------+
-| Oracle      | ``django.db.backends.oracle``                 | ``oracle://USER:PASSWORD@HOST:PORT/NAME`` [3]_   |
-+-------------+-----------------------------------------------+--------------------------------------------------+
-| Oracle (GIS)| ``django.contrib.gis.db.backends.oracle``     | ``oraclegis://USER:PASSWORD@HOST:PORT/NAME``     |
-+-------------+-----------------------------------------------+--------------------------------------------------+
-| Redshift    | ``django_redshift_backend``                   | ``redshift://USER:PASSWORD@HOST:PORT/NAME``      |
-+-------------+-----------------------------------------------+--------------------------------------------------+
-
-.. [1] With PostgreSQL, you can also use unix domain socket paths with
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Engine               | Django Backend                                | URL                                              |
++======================+===============================================+==================================================+
+| PostgreSQL           | ``django.db.backends.postgresql`` [1]_        | ``postgres://USER:PASSWORD@HOST:PORT/NAME`` [2]_ |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| PostGIS              | ``django.contrib.gis.db.backends.postgis``    | ``postgis://USER:PASSWORD@HOST:PORT/NAME``       |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MSSQL                | ``sql_server.pyodbc``                         | ``mssql://USER:PASSWORD@HOST:PORT/NAME``         |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MSSQL [5]_           | ``mssql``                                     | ``mssqlms://USER:PASSWORD@HOST:PORT/NAME``       |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MySQL                | ``django.db.backends.mysql``                  | ``mysql://USER:PASSWORD@HOST:PORT/NAME`` [2]_    |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MySQL (GIS)          | ``django.contrib.gis.db.backends.mysql``      | ``mysqlgis://USER:PASSWORD@HOST:PORT/NAME``      |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| SQLite               | ``django.db.backends.sqlite3``                | ``sqlite:///PATH`` [3]_                          |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| SpatiaLite           | ``django.contrib.gis.db.backends.spatialite`` | ``spatialite:///PATH`` [3]_                      |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Oracle               | ``django.db.backends.oracle``                 | ``oracle://USER:PASSWORD@HOST:PORT/NAME`` [4]_   |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Oracle (GIS)         | ``django.contrib.gis.db.backends.oracle``     | ``oraclegis://USER:PASSWORD@HOST:PORT/NAME``     |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Redshift             | ``django_redshift_backend``                   | ``redshift://USER:PASSWORD@HOST:PORT/NAME``      |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| CockroachDB          | ``django_cockroachdb``                        | ``cockroach://USER:PASSWORD@HOST:PORT/NAME``     |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Timescale [6]_       | ``timescale.db.backends.postgresql``          | ``timescale://USER:PASSWORD@HOST:PORT/NAME``     |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Timescale (GIS) [6]_ | ``timescale.db.backend.postgis``              | ``timescalegis://USER:PASSWORD@HOST:PORT/NAME``  |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+
+.. [1] The django.db.backends.postgresql backend is named django.db.backends.postgresql_psycopg2 in older releases. For
+       backwards compatibility, the old name still works in newer versions. (The new name does not work in older versions).
+.. [2] With PostgreSQL or CloudSQL, you can also use unix domain socket paths with
        `percent encoding <http://www.postgresql.org/docs/9.2/interactive/libpq-connect.html#AEN38162>`_:
-       ``postgres://%2Fvar%2Flib%2Fpostgresql/dbname``.
-.. [2] SQLite connects to file based databases. The same URL format is used, omitting
+       ``postgres://%2Fvar%2Flib%2Fpostgresql/dbname``
+       ``mysql://uf07k1i6d8ia0v@%2fcloudsql%2fproject%3alocation%3ainstance/dbname``
+.. [3] SQLite connects to file based databases. The same URL format is used, omitting
        the hostname, and using the "file" portion as the filename of the database.
        This has the effect of four slashes being present for an absolute file path:
        ``sqlite:////full/path/to/your/database/file.sqlite``.
-.. [3] Note that when connecting to Oracle the URL isn't in the form you may know
+.. [4] Note that when connecting to Oracle the URL isn't in the form you may know
        from using other Oracle tools (like SQLPlus) i.e. user and password are separated
        by ``:`` not by ``/``. Also you can omit ``HOST`` and ``PORT``
        and provide a full DSN string or TNS name in ``NAME`` part.
+.. [5] Microsoft official `mssql-django <https://github.com/microsoft/mssql-django>`_ adapter.
+.. [6] Using the django-timescaledb Package which must be installed.
+
+
+Contributing
+------------
+
+We welcome contributions to this project. Projects can take two forms:
+
+1. Raising issues or helping others through the github issue tracker.
+2. Contributing code.
+
+Raising Issues or helping others:
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When submitting an issue or helping other remember you are talking to humans who have feelings, jobs and lives of their
+own. Be nice, be kind, be polite. Remember english may not be someone first language, if you do not understand or
+something is not clear be polite and re-ask/ re-word.
+
+Contributing code:
+^^^^^^^^^^^^^^^^^^
+
+* Before writing code be sure to check existing PR's and issues in the tracker.
+* Write code to the pylint spec.
+* Large or wide sweeping changes will take longer, and may face more scrutiny than smaller confined changes.
+* Code should be pass `black` and `flake8` validation.
diff --git a/debian/changelog b/debian/changelog
index 53ae6fb..5d50ef6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+dj-database-url (1.2.0-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Wed, 14 Dec 2022 16:15:03 -0000
+
 dj-database-url (0.5.0-2) unstable; urgency=medium
 
   * debian/control:
diff --git a/dj_database_url.egg-info/PKG-INFO b/dj_database_url.egg-info/PKG-INFO
index 24e6d46..5d940c8 100644
--- a/dj_database_url.egg-info/PKG-INFO
+++ b/dj_database_url.egg-info/PKG-INFO
@@ -1,69 +1,16 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: dj-database-url
-Version: 0.5.0
+Version: 1.2.0
 Summary: Use Database URLs in your Django Application.
-Home-page: https://github.com/kennethreitz/dj-database-url
-Author: Kenneth Reitz
-Author-email: me@kennethreitz.com
+Home-page: https://github.com/jazzband/dj-database-url
+Author: Original Author: Kenneth Reitz, Maintained by: JazzBand Community
 License: BSD
-Description-Content-Type: UNKNOWN
-Description: 
-        dj-database-url
-        ~~~~~~~~~~~~~~~
-        
-        .. image:: https://secure.travis-ci.org/kennethreitz/dj-database-url.png?branch=master
-           :target: http://travis-ci.org/kennethreitz/dj-database-url
-        
-        This simple Django utility allows you to utilize the
-        `12factor <http://www.12factor.net/backing-services>`_ inspired
-        ``DATABASE_URL`` environment variable to configure your Django application.
-        
-        The ``dj_database_url.config`` method returns a Django database connection
-        dictionary, populated with all the data specified in your URL. There is
-        also a `conn_max_age` argument to easily enable Django's connection pool.
-        
-        If you'd rather not use an environment variable, you can pass a URL in directly
-        instead to ``dj_database_url.parse``.
-        
-        Supported Databases
-        -------------------
-        
-        Support currently exists for PostgreSQL, PostGIS, MySQL, MySQL (GIS),
-        Oracle, Oracle (GIS), and SQLite.
-        
-        Installation
-        ------------
-        
-        Installation is simple::
-        
-            $ pip install dj-database-url
-        
-        Usage
-        -----
-        
-        Configure your database in ``settings.py`` from ``DATABASE_URL``::
-        
-            import dj_database_url
-        
-            DATABASES['default'] = dj_database_url.config(conn_max_age=600, ssl_require=True)
-        
-        Provide a default::
-        
-            DATABASES['default'] = dj_database_url.config(default='postgres://...'}
-        
-        Parse an arbitrary Database URL::
-        
-            DATABASES['default'] = dj_database_url.parse('postgres://...', conn_max_age=600)
-        
-        The ``conn_max_age`` attribute is the lifetime of a database connection in seconds
-        and is available in Django 1.6+. If you do not set a value, it will default to ``0``
-        which is Django's historical behavior of using a new database connection on each
-        request. Use ``None`` for unlimited persistent connections.
-        
-        
-        
 Platform: any
 Classifier: Environment :: Web Environment
+Classifier: Framework :: Django
+Classifier: Framework :: Django :: 3.2
+Classifier: Framework :: Django :: 4.0
+Classifier: Framework :: Django :: 4.1
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: BSD License
 Classifier: Operating System :: OS Independent
@@ -71,9 +18,237 @@ Classifier: Programming Language :: Python
 Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
 Classifier: Topic :: Software Development :: Libraries :: Python Modules
 Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Description-Content-Type: text/x-rst
+License-File: LICENSE
+
+DJ-Database-URL
+~~~~~~~~~~~~~~~
+
+.. image:: https://jazzband.co/static/img/badge.png
+   :target: https://jazzband.co/
+   :alt: Jazzband
+
+.. image:: https://github.com/jazzband/dj-database-url/actions/workflows/test.yml/badge.svg
+   :target: https://github.com/jazzband/dj-database-url/actions/workflows/test.yml
+
+.. image:: https://codecov.io/gh/jazzband/dj-database-url/branch/master/graph/badge.svg?token=7srBUpszOa
+   :target: https://codecov.io/gh/jazzband/dj-database-url
+
+This simple Django utility allows you to utilize the
+`12factor <http://www.12factor.net/backing-services>`_ inspired
+``DATABASE_URL`` environment variable to configure your Django application.
+
+The ``dj_database_url.config`` method returns a Django database connection
+dictionary, populated with all the data specified in your URL. There is
+also a `conn_max_age` argument to easily enable Django's connection pool.
+
+If you'd rather not use an environment variable, you can pass a URL in directly
+instead to ``dj_database_url.parse``.
+
+Supported Databases
+-------------------
+
+Support currently exists for PostgreSQL, PostGIS, MySQL, MySQL (GIS),
+Oracle, Oracle (GIS), Redshift, CockroachDB, Timescale, Timescale (GIS) and SQLite.
+
+Installation
+------------
+
+Installation is simple:
+
+.. code-block:: console
+
+    $ pip install dj-database-url
+
+Usage
+-----
+
+1. If ``DATABASES`` is already defined:
+
+- Configure your database in ``settings.py`` from ``DATABASE_URL``:
+
+  .. code-block:: python
+
+      import dj_database_url
+
+      DATABASES['default'] = dj_database_url.config(
+          conn_max_age=600,
+          conn_health_checks=True,
+      )
+
+- Provide a default:
+
+  .. code-block:: python
+
+      DATABASES['default'] = dj_database_url.config(
+          default='postgres://...',
+          conn_max_age=600,
+          conn_health_checks=True,
+      )
+
+- Parse an arbitrary Database URL:
+
+  .. code-block:: python
+
+      DATABASES['default'] = dj_database_url.parse(
+          'postgres://...',
+          conn_max_age=600,
+          conn_health_checks=True,
+      )
+
+2. If ``DATABASES`` is not defined:
+
+- Configure your database in ``settings.py`` from ``DATABASE_URL``:
+
+  .. code-block:: python
+
+      import dj_database_url
+
+      DATABASES = {
+          'default': dj_database_url.config(
+              conn_max_age=600,
+              conn_health_checks=True,
+          ),
+      }
+
+- You can provide a default, used if the ``DATABASE_URL`` setting is not defined:
+
+  .. code-block:: python
+
+      DATABASES = {
+          'default': dj_database_url.config(
+              default='postgres://...',
+              conn_max_age=600,
+              conn_health_checks=True,
+          )
+      }
+
+- Parse an arbitrary Database URL:
+
+  .. code-block:: python
+
+      DATABASES = {
+          'default': dj_database_url.parse(
+              'postgres://...',
+              conn_max_age=600,
+              conn_health_checks=True,
+          )
+      }
+
+``conn_max_age`` sets the |CONN_MAX_AGE setting|__, which tells Django to
+persist database connections between requests, up to the given lifetime in
+seconds. If you do not provide a value, it will follow Django’s default of
+``0``. Setting it is recommended for performance.
+
+.. |CONN_MAX_AGE setting| replace:: ``CONN_MAX_AGE`` setting
+__ https://docs.djangoproject.com/en/stable/ref/settings/#conn-max-age
+
+``conn_health_checks`` sets the |CONN_HEALTH_CHECKS setting|__ (new in Django
+4.1), which tells Django to check a persisted connection still works at the
+start of each request. If you do not provide a value, it will follow Django’s
+default of ``False``. Enabling it is recommended if you set a non-zero
+``conn_max_age``.
+
+.. |CONN_HEALTH_CHECKS setting| replace:: ``CONN_HEALTH_CHECKS`` setting
+__ https://docs.djangoproject.com/en/stable/ref/settings/#conn-health-checks
+
+Strings passed to `dj_database_url` must be valid URLs; in
+particular, special characters must be url-encoded. The following url will raise
+a `ValueError`:
+
+.. code-block:: plaintext
+
+    postgres://user:p#ssword!@localhost/foobar
+
+and should instead be passed as:
+
+.. code-block:: plaintext
+
+    postgres://user:p%23ssword!@localhost/foobar
+
+`TEST <https://docs.djangoproject.com/en/stable/ref/settings/#test>`_ settings can be configured using the ``test_options`` attribute::
+
+    DATABASES['default'] = dj_database_url.config(default='postgres://...', test_options={'NAME': 'mytestdatabase'})
+
+
+URL schema
+----------
+
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Engine               | Django Backend                                | URL                                              |
++======================+===============================================+==================================================+
+| PostgreSQL           | ``django.db.backends.postgresql`` [1]_        | ``postgres://USER:PASSWORD@HOST:PORT/NAME`` [2]_ |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| PostGIS              | ``django.contrib.gis.db.backends.postgis``    | ``postgis://USER:PASSWORD@HOST:PORT/NAME``       |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MSSQL                | ``sql_server.pyodbc``                         | ``mssql://USER:PASSWORD@HOST:PORT/NAME``         |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MSSQL [5]_           | ``mssql``                                     | ``mssqlms://USER:PASSWORD@HOST:PORT/NAME``       |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MySQL                | ``django.db.backends.mysql``                  | ``mysql://USER:PASSWORD@HOST:PORT/NAME`` [2]_    |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| MySQL (GIS)          | ``django.contrib.gis.db.backends.mysql``      | ``mysqlgis://USER:PASSWORD@HOST:PORT/NAME``      |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| SQLite               | ``django.db.backends.sqlite3``                | ``sqlite:///PATH`` [3]_                          |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| SpatiaLite           | ``django.contrib.gis.db.backends.spatialite`` | ``spatialite:///PATH`` [3]_                      |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Oracle               | ``django.db.backends.oracle``                 | ``oracle://USER:PASSWORD@HOST:PORT/NAME`` [4]_   |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Oracle (GIS)         | ``django.contrib.gis.db.backends.oracle``     | ``oraclegis://USER:PASSWORD@HOST:PORT/NAME``     |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Redshift             | ``django_redshift_backend``                   | ``redshift://USER:PASSWORD@HOST:PORT/NAME``      |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| CockroachDB          | ``django_cockroachdb``                        | ``cockroach://USER:PASSWORD@HOST:PORT/NAME``     |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Timescale [6]_       | ``timescale.db.backends.postgresql``          | ``timescale://USER:PASSWORD@HOST:PORT/NAME``     |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+| Timescale (GIS) [6]_ | ``timescale.db.backend.postgis``              | ``timescalegis://USER:PASSWORD@HOST:PORT/NAME``  |
++----------------------+-----------------------------------------------+--------------------------------------------------+
+
+.. [1] The django.db.backends.postgresql backend is named django.db.backends.postgresql_psycopg2 in older releases. For
+       backwards compatibility, the old name still works in newer versions. (The new name does not work in older versions).
+.. [2] With PostgreSQL or CloudSQL, you can also use unix domain socket paths with
+       `percent encoding <http://www.postgresql.org/docs/9.2/interactive/libpq-connect.html#AEN38162>`_:
+       ``postgres://%2Fvar%2Flib%2Fpostgresql/dbname``
+       ``mysql://uf07k1i6d8ia0v@%2fcloudsql%2fproject%3alocation%3ainstance/dbname``
+.. [3] SQLite connects to file based databases. The same URL format is used, omitting
+       the hostname, and using the "file" portion as the filename of the database.
+       This has the effect of four slashes being present for an absolute file path:
+       ``sqlite:////full/path/to/your/database/file.sqlite``.
+.. [4] Note that when connecting to Oracle the URL isn't in the form you may know
+       from using other Oracle tools (like SQLPlus) i.e. user and password are separated
+       by ``:`` not by ``/``. Also you can omit ``HOST`` and ``PORT``
+       and provide a full DSN string or TNS name in ``NAME`` part.
+.. [5] Microsoft official `mssql-django <https://github.com/microsoft/mssql-django>`_ adapter.
+.. [6] Using the django-timescaledb Package which must be installed.
+
+
+Contributing
+------------
+
+We welcome contributions to this project. Projects can take two forms:
+
+1. Raising issues or helping others through the github issue tracker.
+2. Contributing code.
+
+Raising Issues or helping others:
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When submitting an issue or helping other remember you are talking to humans who have feelings, jobs and lives of their
+own. Be nice, be kind, be polite. Remember english may not be someone first language, if you do not understand or
+something is not clear be polite and re-ask/ re-word.
+
+Contributing code:
+^^^^^^^^^^^^^^^^^^
+
+* Before writing code be sure to check existing PR's and issues in the tracker.
+* Write code to the pylint spec.
+* Large or wide sweeping changes will take longer, and may face more scrutiny than smaller confined changes.
+* Code should be pass `black` and `flake8` validation.
diff --git a/dj_database_url.egg-info/SOURCES.txt b/dj_database_url.egg-info/SOURCES.txt
index b99b03b..82dcc1a 100644
--- a/dj_database_url.egg-info/SOURCES.txt
+++ b/dj_database_url.egg-info/SOURCES.txt
@@ -1,10 +1,11 @@
 LICENSE
-MANIFEST.in
 README.rst
 dj_database_url.py
+pyproject.toml
 setup.py
 dj_database_url.egg-info/PKG-INFO
 dj_database_url.egg-info/SOURCES.txt
 dj_database_url.egg-info/dependency_links.txt
 dj_database_url.egg-info/not-zip-safe
+dj_database_url.egg-info/requires.txt
 dj_database_url.egg-info/top_level.txt
\ No newline at end of file
diff --git a/dj_database_url.egg-info/requires.txt b/dj_database_url.egg-info/requires.txt
new file mode 100644
index 0000000..d273c18
--- /dev/null
+++ b/dj_database_url.egg-info/requires.txt
@@ -0,0 +1 @@
+Django>=3.2
diff --git a/dj_database_url.py b/dj_database_url.py
index 32a4f6c..39f7405 100644
--- a/dj_database_url.py
+++ b/dj_database_url.py
@@ -1,144 +1,175 @@
-# -*- coding: utf-8 -*-
-
 import os
-
-try:
-    import urlparse
-except ImportError:
-    import urllib.parse as urlparse
-
+import urllib.parse as urlparse
 
 # Register database schemes in URLs.
-urlparse.uses_netloc.append('postgres')
-urlparse.uses_netloc.append('postgresql')
-urlparse.uses_netloc.append('pgsql')
-urlparse.uses_netloc.append('postgis')
-urlparse.uses_netloc.append('mysql')
-urlparse.uses_netloc.append('mysql2')
-urlparse.uses_netloc.append('mysqlgis')
-urlparse.uses_netloc.append('mysql-connector')
-urlparse.uses_netloc.append('mssql')
-urlparse.uses_netloc.append('spatialite')
-urlparse.uses_netloc.append('sqlite')
-urlparse.uses_netloc.append('oracle')
-urlparse.uses_netloc.append('oraclegis')
-urlparse.uses_netloc.append('redshift')
-
-DEFAULT_ENV = 'DATABASE_URL'
+urlparse.uses_netloc.append("postgres")
+urlparse.uses_netloc.append("postgresql")
+urlparse.uses_netloc.append("pgsql")
+urlparse.uses_netloc.append("postgis")
+urlparse.uses_netloc.append("mysql")
+urlparse.uses_netloc.append("mysql2")
+urlparse.uses_netloc.append("mysqlgis")
+urlparse.uses_netloc.append("mysql-connector")
+urlparse.uses_netloc.append("mssql")
+urlparse.uses_netloc.append("mssqlms")
+urlparse.uses_netloc.append("spatialite")
+urlparse.uses_netloc.append("sqlite")
+urlparse.uses_netloc.append("oracle")
+urlparse.uses_netloc.append("oraclegis")
+urlparse.uses_netloc.append("redshift")
+urlparse.uses_netloc.append("cockroach")
+urlparse.uses_netloc.append("timescale")
+urlparse.uses_netloc.append("timescalegis")
+
+DEFAULT_ENV = "DATABASE_URL"
 
 SCHEMES = {
-    'postgres': 'django.db.backends.postgresql_psycopg2',
-    'postgresql': 'django.db.backends.postgresql_psycopg2',
-    'pgsql': 'django.db.backends.postgresql_psycopg2',
-    'postgis': 'django.contrib.gis.db.backends.postgis',
-    'mysql': 'django.db.backends.mysql',
-    'mysql2': 'django.db.backends.mysql',
-    'mysqlgis': 'django.contrib.gis.db.backends.mysql',
-    'mysql-connector': 'mysql.connector.django',
-    'mssql': 'sql_server.pyodbc',
-    'spatialite': 'django.contrib.gis.db.backends.spatialite',
-    'sqlite': 'django.db.backends.sqlite3',
-    'oracle': 'django.db.backends.oracle',
-    'oraclegis': 'django.contrib.gis.db.backends.oracle',
-    'redshift': 'django_redshift_backend',
+    "postgres": "django.db.backends.postgresql",
+    "postgresql": "django.db.backends.postgresql",
+    "pgsql": "django.db.backends.postgresql",
+    "postgis": "django.contrib.gis.db.backends.postgis",
+    "mysql": "django.db.backends.mysql",
+    "mysql2": "django.db.backends.mysql",
+    "mysqlgis": "django.contrib.gis.db.backends.mysql",
+    "mysql-connector": "mysql.connector.django",
+    "mssql": "sql_server.pyodbc",
+    "mssqlms": "mssql",
+    "spatialite": "django.contrib.gis.db.backends.spatialite",
+    "sqlite": "django.db.backends.sqlite3",
+    "oracle": "django.db.backends.oracle",
+    "oraclegis": "django.contrib.gis.db.backends.oracle",
+    "redshift": "django_redshift_backend",
+    "cockroach": "django_cockroachdb",
+    "timescale": "timescale.db.backends.postgresql",
+    "timescalegis": "timescale.db.backends.postgis",
 }
 
 
-def config(env=DEFAULT_ENV, default=None, engine=None, conn_max_age=0, ssl_require=False):
+def config(
+    env=DEFAULT_ENV,
+    default=None,
+    engine=None,
+    conn_max_age=0,
+    conn_health_checks=False,
+    ssl_require=False,
+    test_options=None,
+):
     """Returns configured DATABASE dictionary from DATABASE_URL."""
-
-    config = {}
-
     s = os.environ.get(env, default)
 
     if s:
-        config = parse(s, engine, conn_max_age, ssl_require)
+        return parse(
+            s, engine, conn_max_age, conn_health_checks, ssl_require, test_options
+        )
 
-    return config
+    return {}
 
 
-def parse(url, engine=None, conn_max_age=0, ssl_require=False):
+def parse(
+    url,
+    engine=None,
+    conn_max_age=0,
+    conn_health_checks=False,
+    ssl_require=False,
+    test_options=None,
+):
     """Parses a database URL."""
-
-    if url == 'sqlite://:memory:':
+    if url == "sqlite://:memory:":
         # this is a special case, because if we pass this URL into
         # urlparse, urlparse will choke trying to interpret "memory"
         # as a port number
-        return {
-            'ENGINE': SCHEMES['sqlite'],
-            'NAME': ':memory:'
-        }
+        return {"ENGINE": SCHEMES["sqlite"], "NAME": ":memory:"}
         # note: no other settings are required for sqlite
 
     # otherwise parse the url as normal
-    config = {}
+    parsed_config = {}
 
-    url = urlparse.urlparse(url)
+    if test_options is None:
+        test_options = {}
+
+    url = urlparse.urlsplit(url)
 
     # Split query strings from path.
     path = url.path[1:]
-    if '?' in path and not url.query:
-        path, query = path.split('?', 2)
+    if "?" in path and not url.query:
+        path, query = path.split("?", 2)
     else:
         path, query = path, url.query
     query = urlparse.parse_qs(query)
 
     # If we are using sqlite and we have no path, then assume we
     # want an in-memory database (this is the behaviour of sqlalchemy)
-    if url.scheme == 'sqlite' and path == '':
-        path = ':memory:'
+    if url.scheme == "sqlite" and path == "":
+        path = ":memory:"
 
     # Handle postgres percent-encoded paths.
-    hostname = url.hostname or ''
-    if '%2f' in hostname.lower():
+    hostname = url.hostname or ""
+    if "%" in hostname:
         # Switch to url.netloc to avoid lower cased paths
         hostname = url.netloc
         if "@" in hostname:
             hostname = hostname.rsplit("@", 1)[1]
         if ":" in hostname:
             hostname = hostname.split(":", 1)[0]
-        hostname = hostname.replace('%2f', '/').replace('%2F', '/')
+        # Use URL Parse library to decode % encodes
+        hostname = urlparse.unquote(hostname)
 
     # Lookup specified engine.
     engine = SCHEMES[url.scheme] if engine is None else engine
 
-    port = (str(url.port) if url.port and engine == SCHEMES['oracle']
-            else url.port)
+    port = (
+        str(url.port)
+        if url.port
+        and engine in (SCHEMES["oracle"], SCHEMES["mssql"], SCHEMES["mssqlms"])
+        else url.port
+    )
 
     # Update with environment configuration.
-    config.update({
-        'NAME': urlparse.unquote(path or ''),
-        'USER': urlparse.unquote(url.username or ''),
-        'PASSWORD': urlparse.unquote(url.password or ''),
-        'HOST': hostname,
-        'PORT': port or '',
-        'CONN_MAX_AGE': conn_max_age,
-    })
+    parsed_config.update(
+        {
+            "NAME": urlparse.unquote(path or ""),
+            "USER": urlparse.unquote(url.username or ""),
+            "PASSWORD": urlparse.unquote(url.password or ""),
+            "HOST": hostname,
+            "PORT": port or "",
+            "CONN_MAX_AGE": conn_max_age,
+            "CONN_HEALTH_CHECKS": conn_health_checks,
+        }
+    )
+    if test_options:
+        parsed_config.update(
+            {
+                'TEST': test_options,
+            }
+        )
 
     # Pass the query string into OPTIONS.
     options = {}
     for key, values in query.items():
-        if url.scheme == 'mysql' and key == 'ssl-ca':
-            options['ssl'] = {'ca': values[-1]}
+        if url.scheme == "mysql" and key == "ssl-ca":
+            options["ssl"] = {"ca": values[-1]}
             continue
 
         options[key] = values[-1]
 
     if ssl_require:
-        options['sslmode'] = 'require'
+        options["sslmode"] = "require"
 
     # Support for Postgres Schema URLs
-    if 'currentSchema' in options and engine in (
-        'django.contrib.gis.db.backends.postgis',
-        'django.db.backends.postgresql_psycopg2',
-        'django_redshift_backend',
+    if "currentSchema" in options and engine in (
+        "django.contrib.gis.db.backends.postgis",
+        "django.db.backends.postgresql_psycopg2",
+        "django.db.backends.postgresql",
+        "django_redshift_backend",
+        "timescale.db.backends.postgresql",
+        "timescale.db.backends.postgis",
     ):
-        options['options'] = '-c search_path={0}'.format(options.pop('currentSchema'))
+        options["options"] = "-c search_path={0}".format(options.pop("currentSchema"))
 
     if options:
-        config['OPTIONS'] = options
+        parsed_config["OPTIONS"] = options
 
     if engine:
-        config['ENGINE'] = engine
+        parsed_config["ENGINE"] = engine
 
-    return config
+    return parsed_config
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..08ca2f5
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,2 @@
+[tool.black]
+skip-string-normalization = 1
diff --git a/setup.py b/setup.py
index 3dbe1b4..e787d12 100644
--- a/setup.py
+++ b/setup.py
@@ -1,138 +1,47 @@
-# -*- coding: utf-8 -*-
-"""
-dj-database-url
-~~~~~~~~~~~~~~~
+from pathlib import Path
 
-.. image:: https://secure.travis-ci.org/kennethreitz/dj-database-url.png?branch=master
-   :target: http://travis-ci.org/kennethreitz/dj-database-url
+from setuptools import setup
 
-This simple Django utility allows you to utilize the
-`12factor <http://www.12factor.net/backing-services>`_ inspired
-``DATABASE_URL`` environment variable to configure your Django application.
-
-The ``dj_database_url.config`` method returns a Django database connection
-dictionary, populated with all the data specified in your URL. There is
-also a `conn_max_age` argument to easily enable Django's connection pool.
-
-If you'd rather not use an environment variable, you can pass a URL in directly
-instead to ``dj_database_url.parse``.
-
-Supported Databases
--------------------
-
-Support currently exists for PostgreSQL, PostGIS, MySQL, MySQL (GIS),
-Oracle, Oracle (GIS), and SQLite.
-
-Installation
-------------
-
-Installation is simple::
-
-    $ pip install dj-database-url
-
-Usage
------
-
-Configure your database in ``settings.py`` from ``DATABASE_URL``::
-
-    import dj_database_url
-
-    DATABASES['default'] = dj_database_url.config(conn_max_age=600, ssl_require=True)
-
-Provide a default::
-
-    DATABASES['default'] = dj_database_url.config(default='postgres://...'}
-
-Parse an arbitrary Database URL::
-
-    DATABASES['default'] = dj_database_url.parse('postgres://...', conn_max_age=600)
-
-The ``conn_max_age`` attribute is the lifetime of a database connection in seconds
-and is available in Django 1.6+. If you do not set a value, it will default to ``0``
-which is Django's historical behavior of using a new database connection on each
-request. Use ``None`` for unlimited persistent connections.
-
-
-"""
-
-import os
-import sys
-from shutil import rmtree
-
-from setuptools import find_packages, setup, Command
-
-
-VERSION = '0.5.0'
-
-here = os.path.abspath(os.path.dirname(__file__))
-
-
-class UploadCommand(Command):
-    """Support setup.py upload."""
-
-    description = 'Build and publish the package.'
-    user_options = []
-
-    @staticmethod
-    def status(s):
-        """Prints things in bold."""
-        print('\033[1m{0}\033[0m'.format(s))
-
-    def initialize_options(self):
-        pass
-
-    def finalize_options(self):
-        pass
-
-    def run(self):
-        try:
-            self.status('Removing previous builds…')
-            rmtree(os.path.join(here, 'dist'))
-        except OSError:
-            pass
-
-        self.status('Building Source and Wheel (universal) distribution…')
-        os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))
-
-        self.status('Uploading the package to PyPi via Twine…')
-        os.system('twine upload dist/*')
-
-        self.status('Pushing git tags…')
-        os.system('git tag v{0}'.format(VERSION))
-        os.system('git push --tags')
-
-        sys.exit()
+readme = Path("README.rst").read_text()
 
 setup(
-    name='dj-database-url',
-    version=VERSION,
-    url='https://github.com/kennethreitz/dj-database-url',
-    license='BSD',
-    author='Kenneth Reitz',
-    author_email='me@kennethreitz.com',
-    description='Use Database URLs in your Django Application.',
-    long_description=__doc__,
-    py_modules=['dj_database_url'],
+    name="dj-database-url",
+    version="1.2.0",
+    url="https://github.com/jazzband/dj-database-url",
+    license="BSD",
+    author="Original Author: Kenneth Reitz, Maintained by: JazzBand Community",
+    description="Use Database URLs in your Django Application.",
+    long_description=readme,
+    long_description_content_type="text/x-rst",
+    py_modules=["dj_database_url"],
+    install_requires=["Django>=3.2"],
     zip_safe=False,
     include_package_data=True,
-    platforms='any',
+    platforms="any",
+    project_links={
+        "GitHub": "https://github.com/jazzband/dj-database-url/",
+        "Release log": (
+            "https://github.com/jazzband/dj-database-url/blob/master/CHANGELOG.md"
+        ),
+    },
     classifiers=[
-        'Environment :: Web Environment',
-        'Intended Audience :: Developers',
-        'License :: OSI Approved :: BSD License',
-        'Operating System :: OS Independent',
-        'Programming Language :: Python',
-        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
-        'Topic :: Software Development :: Libraries :: Python Modules',
-        'Programming Language :: Python',
-        'Programming Language :: Python :: 2.7',
-        'Programming Language :: Python :: 3',
-        'Programming Language :: Python :: 3.2',
-        'Programming Language :: Python :: 3.3',
-        'Programming Language :: Python :: 3.4',
-        'Programming Language :: Python :: 3.5',
+        "Environment :: Web Environment",
+        "Framework :: Django",
+        "Framework :: Django :: 3.2",
+        "Framework :: Django :: 4.0",
+        "Framework :: Django :: 4.1",
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: BSD License",
+        "Operating System :: OS Independent",
+        "Programming Language :: Python",
+        "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+        "Programming Language :: Python",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
     ],
-    cmdclass={
-        'upload': UploadCommand,
-    },
 )

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/lib/python3/dist-packages/dj_database_url-1.2.0.egg-info/PKG-INFO
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/dj_database_url-1.2.0.egg-info/dependency_links.txt
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/dj_database_url-1.2.0.egg-info/not-zip-safe
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/dj_database_url-1.2.0.egg-info/requires.txt
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/dj_database_url-1.2.0.egg-info/top_level.txt

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/lib/python3/dist-packages/dj_database_url-0.5.0.egg-info/PKG-INFO
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/dj_database_url-0.5.0.egg-info/dependency_links.txt
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/dj_database_url-0.5.0.egg-info/not-zip-safe
-rw-r--r--  root/root   /usr/lib/python3/dist-packages/dj_database_url-0.5.0.egg-info/top_level.txt

Control files: lines which differ (wdiff format)

  • Depends: python3-django, python3:any

More details

Full run details