summaryrefslogtreecommitdiff
path: root/horizon/__init__.py
diff options
context:
space:
mode:
authorGabriel Hurley <gabriel@strikeawe.com>2012-03-01 12:01:17 -0800
committerGabriel Hurley <gabriel@strikeawe.com>2012-03-01 12:08:40 -0800
commit28c1a252f4877829e40ced7b1b8f12c7b0d33bda (patch)
tree7a2c1e89e4f14404aefc3cde082bb9e47dbe4127 /horizon/__init__.py
parentd57a34c5b1af8c63ad20cbff177907471d6ccd88 (diff)
downloadhorizon-28c1a252f4877829e40ced7b1b8f12c7b0d33bda.tar.gz
Require django >= 1.3.1 and rework __init__ to make installing easier.
Change-Id: I43c90755db4f9dfa4202d57b80f0b674e9a8a670
Diffstat (limited to 'horizon/__init__.py')
-rw-r--r--horizon/__init__.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/horizon/__init__.py b/horizon/__init__.py
index ebd34afd2..bd6380a36 100644
--- a/horizon/__init__.py
+++ b/horizon/__init__.py
@@ -24,26 +24,26 @@ methods like :func:`~horizon.register` and :func:`~horizon.unregister`.
# Because this module is compiled by setup.py before Django may be installed
# in the environment we try importing Django and issue a warning but move on
# should that fail.
-django = None
+Horizon = None
try:
- import django
+ from horizon.base import Horizon, Dashboard, Panel, Workflow
except ImportError:
import warnings
def simple_warn(message, category, filename, lineno, file=None, line=None):
return '%s: %s' % (category.__name__, message)
- msg = ("Could not import Django. This is normal during installation.\n")
+ msg = ("Could not import Horizon dependencies. "
+ "This is normal during installation.\n")
warnings.formatwarning = simple_warn
warnings.warn(msg, Warning)
-if django:
+if Horizon:
# This can be removed once the upstream bug is fixed.
+ import django
if django.VERSION < (1, 4):
from horizon.utils import reverse_bugfix
- from horizon.base import Horizon, Dashboard, Panel, Workflow
-
register = Horizon.register
unregister = Horizon.unregister
get_absolute_url = Horizon.get_absolute_url