summaryrefslogtreecommitdiff
path: root/django/conf/__init__.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-02-16 07:59:44 -0500
committerGitHub <noreply@github.com>2017-02-16 07:59:44 -0500
commit80493b087136a151bf4d11ba394f36e047159040 (patch)
tree8b9df561f9eb919deda285da05b6d4b3c1f7c71b /django/conf/__init__.py
parentb008f7cc5655d01817a8825e6317877b43c92181 (diff)
downloaddjango-80493b087136a151bf4d11ba394f36e047159040.tar.gz
Fixed #27829 -- Deprecated settings.DEFAULT_CONTENT_TYPE.
Diffstat (limited to 'django/conf/__init__.py')
-rw-r--r--django/conf/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index 2f2cec6f84..1d90d6fc0a 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -9,9 +9,11 @@ a list of all possible variables.
import importlib
import os
import time
+import warnings
from django.conf import global_settings
from django.core.exceptions import ImproperlyConfigured
+from django.utils.deprecation import RemovedInDjango30Warning
from django.utils.functional import LazyObject, empty
ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
@@ -128,6 +130,9 @@ class Settings:
if not self.SECRET_KEY:
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
+ if self.is_overridden('DEFAULT_CONTENT_TYPE'):
+ warnings.warn('The DEFAULT_CONTENT_TYPE setting is deprecated.', RemovedInDjango30Warning)
+
if hasattr(time, 'tzset') and self.TIME_ZONE:
# When we can, attempt to validate the timezone. If we can't find
# this file, no check happens and it's harmless.
@@ -173,6 +178,8 @@ class UserSettingsHolder:
def __setattr__(self, name, value):
self._deleted.discard(name)
+ if name == 'DEFAULT_CONTENT_TYPE':
+ warnings.warn('The DEFAULT_CONTENT_TYPE setting is deprecated.', RemovedInDjango30Warning)
super().__setattr__(name, value)
def __delattr__(self, name):