summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-03-31 11:44:57 +0000
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-03-31 11:44:57 +0000
commit9e11ff2665cceeba7b53557f4eeb0689ac71d54a (patch)
tree94f00ec1e369f4132c2892e289828971201ba997
parenta1ffb021072026ad58546609cd2c34f737fd26cc (diff)
Prevented Django from running with an empty secret key. Refs #17800.
This accelerated deprecation schedule was documented in r17617. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17836 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/conf/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index a3f7ee00a0..c81456dd92 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -12,6 +12,7 @@ import time # Needed for Windows
import warnings
from django.conf import global_settings
+from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import LazyObject, empty
from django.utils import importlib
@@ -107,7 +108,7 @@ class Settings(BaseSettings):
setattr(self, setting, setting_value)
if not self.SECRET_KEY:
- warnings.warn("The SECRET_KEY setting must not be empty.", DeprecationWarning)
+ raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
if hasattr(time, 'tzset') and self.TIME_ZONE:
# When we can, attempt to validate the timezone. If we can't find