From 3f0c4fe18fe9850bb2f56be138012add4b54873d Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 25 Jan 2017 09:23:04 -0500 Subject: [PATCH] Refs #25175 -- Deprecated db.backends.postgresql_psycopg2 module. --- django/db/backends/postgresql_psycopg2/__init__.py | 9 +++++++++ docs/internals/deprecation.txt | 2 ++ docs/releases/2.0.txt | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/django/db/backends/postgresql_psycopg2/__init__.py b/django/db/backends/postgresql_psycopg2/__init__.py index e69de29bb2..db97c5bcc9 100644 --- a/django/db/backends/postgresql_psycopg2/__init__.py +++ b/django/db/backends/postgresql_psycopg2/__init__.py @@ -0,0 +1,9 @@ +import warnings + +from django.utils.deprecation import RemovedInDjango30Warning + +warnings.warn( + "The django.db.backends.postgresql_psycopg2 module is deprecated in " + "favor of django.db.backends.postgresql.", + RemovedInDjango30Warning, stacklevel=2 +) diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index eface82d4c..d6123b6b53 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -15,6 +15,8 @@ about each item can often be found in the release notes of two versions prior. See the :ref:`Django 2.0 release notes` for more details on these changes. +* The ``django.db.backends.postgresql_psycopg2`` module will be removed. + .. _deprecation-removed-in-2.1: 2.1 diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index a4c4e75920..519b7cd947 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -225,7 +225,12 @@ Features deprecated in 2.0 Miscellaneous ------------- -* ... +* The ``django.db.backends.postgresql_psycopg2`` module is deprecated in favor + of ``django.db.backends.postgresql``. It's been an alias since Django 1.9. + This only affects code that imports from the module directly. The + ``DATABASES`` setting can still use + ``'django.db.backends.postgresql_psycopg2'``, though you can simplify that by + using the ``'django.db.backends.postgresql'`` name added in Django 1.9. .. _removed-features-2.0: