summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-07-16 22:12:24 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-07-16 22:12:24 +0000
commit60bdadb9a3464a7f1f322655dc32d6a33d754be7 (patch)
treee7155d6cd5d911462d9c03464fe2fea71e60e5d5
parent980b3ce696b52c73064193dcd9b9f63ae067b56a (diff)
Moved django.core.handler.ImproperlyConfigured into django.core.exceptions
git-svn-id: http://code.djangoproject.com/svn/django/trunk@120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/exceptions.py4
-rw-r--r--django/core/handler.py7
2 files changed, 6 insertions, 5 deletions
diff --git a/django/core/exceptions.py b/django/core/exceptions.py
index 68036f2d7f..9d1aab665f 100644
--- a/django/core/exceptions.py
+++ b/django/core/exceptions.py
@@ -24,3 +24,7 @@ class ViewDoesNotExist(Exception):
class MiddlewareNotUsed(Exception):
"This middleware is not used in this server configuration"
pass
+
+class ImproperlyConfigured(Exception):
+ "Django is somehow improperly configured"
+ pass
diff --git a/django/core/handler.py b/django/core/handler.py
index 42f4c69d4c..4abc937aa6 100644
--- a/django/core/handler.py
+++ b/django/core/handler.py
@@ -5,9 +5,6 @@ from django.utils import httpwrappers
# settings) until after CoreHandler has been called; otherwise os.environ
# won't be set up correctly (with respect to settings).
-class ImproperlyConfigured(Exception):
- pass
-
class CoreHandler:
def __init__(self):
@@ -57,11 +54,11 @@ class CoreHandler:
try:
mod = __import__(mw_module, '', '', [''])
except ImportError, e:
- raise ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)
+ raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: "%s"' % (mw_module, e)
try:
mw_class = getattr(mod, mw_classname)
except AttributeError:
- raise ImproperlyConfigured, 'Middleware module "%s" does not define a "%s" class' % (mw_module, mw_classname)
+ raise exceptions.ImproperlyConfigured, 'Middleware module "%s" does not define a "%s" class' % (mw_module, mw_classname)
try:
mw_instance = mw_class()