فهرست منبع

Deprecated django.utils.dictconfig.

The module still exists for whoever uses it in its current state, but it
isn't imported by Django anywhere.
Aymeric Augustin 11 سال پیش
والد
کامیت
72c65fea41
6فایلهای تغییر یافته به همراه15 افزوده شده و 16 حذف شده
  1. 1 1
      django/conf/global_settings.py
  2. 5 0
      django/utils/dictconfig.py
  3. 1 6
      django/utils/log.py
  4. 2 0
      docs/internals/deprecation.txt
  5. 6 0
      docs/releases/1.7.txt
  6. 0 9
      docs/topics/logging.txt

+ 1 - 1
django/conf/global_settings.py

@@ -562,7 +562,7 @@ MESSAGE_STORAGE = 'django.contrib.messages.storage.fallback.FallbackStorage'
 ###########
 
 # The callable to use to configure logging
-LOGGING_CONFIG = 'django.utils.log.dictConfig'
+LOGGING_CONFIG = 'logging.config.dictConfig'
 
 # Custom logging configuration.
 LOGGING = {}

+ 5 - 0
django/utils/dictconfig.py

@@ -1,3 +1,8 @@
+import warnings
+
+warnings.warn("django.utils.dictconfig will be removed in Django 1.9.",
+    PendingDeprecationWarning, stacklevel=2)
+
 # This is a copy of the Python logging.config.dictconfig module,
 # reproduced with permission. It is provided here for backwards
 # compatibility for Python versions prior to 2.7.

+ 1 - 6
django/utils/log.py

@@ -16,12 +16,7 @@ except ImportError:
         def emit(self, record):
             pass
 
-# Make sure that dictConfig is available
-# This was added in Python 2.7/3.2
-try:
-    from logging.config import dictConfig
-except ImportError:
-    from django.utils.dictconfig import dictConfig
+from logging.config import dictConfig
 
 getLogger = logging.getLogger
 

+ 2 - 0
docs/internals/deprecation.txt

@@ -410,6 +410,8 @@ these changes.
 1.9
 ---
 
+* ``django.utils.dictconfig`` will be removed.
+
 * ``django.utils.unittest`` will be removed.
 
 2.0

+ 6 - 0
docs/releases/1.7.txt

@@ -31,6 +31,12 @@ Backwards incompatible changes in 1.7
 Features deprecated in 1.7
 ==========================
 
+``django.utils.dictconfig``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``django.utils.dictconfig`` was a copy of :mod:`logging.config` provided for
+Python versions prior to 2.7. It has been deprecated.
+
 ``django.utils.unittest``
 ~~~~~~~~~~~~~~~~~~~~~~~~~
 

+ 0 - 9
docs/topics/logging.txt

@@ -205,13 +205,6 @@ Python's logging library provides several techniques to configure
 logging, ranging from a programmatic interface to configuration files.
 By default, Django uses the `dictConfig format`_.
 
-.. note::
-    ``logging.dictConfig`` is a builtin library in Python 2.7. In
-    order to make this library available for users of earlier Python
-    versions, Django includes a copy as part of ``django.utils.log``.
-    If you have Python 2.7 or later, the system native library will be used; if
-    you have Python 2.6, Django's copy will be used.
-
 In order to configure logging, you use :setting:`LOGGING` to define a
 dictionary of logging settings. These settings describes the loggers,
 handlers, filters and formatters that you want in your logging setup,
@@ -234,8 +227,6 @@ use in your project code.
 
 .. _dictConfig format: http://docs.python.org/library/logging.config.html#configuration-dictionary-schema
 
-.. _a third-party library: http://bitbucket.org/vinay.sajip/dictconfig
-
 An example
 ----------