Require django >= 1.3.1 and rework __init__ to make installing easier.
Change-Id: I43c90755db4f9dfa4202d57b80f0b674e9a8a670
This commit is contained in:
parent
d57a34c5b1
commit
28c1a252f4
@ -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
|
# 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
|
# in the environment we try importing Django and issue a warning but move on
|
||||||
# should that fail.
|
# should that fail.
|
||||||
django = None
|
Horizon = None
|
||||||
try:
|
try:
|
||||||
import django
|
from horizon.base import Horizon, Dashboard, Panel, Workflow
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
def simple_warn(message, category, filename, lineno, file=None, line=None):
|
def simple_warn(message, category, filename, lineno, file=None, line=None):
|
||||||
return '%s: %s' % (category.__name__, message)
|
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.formatwarning = simple_warn
|
||||||
warnings.warn(msg, Warning)
|
warnings.warn(msg, Warning)
|
||||||
|
|
||||||
if django:
|
if Horizon:
|
||||||
# This can be removed once the upstream bug is fixed.
|
# This can be removed once the upstream bug is fixed.
|
||||||
|
import django
|
||||||
if django.VERSION < (1, 4):
|
if django.VERSION < (1, 4):
|
||||||
from horizon.utils import reverse_bugfix
|
from horizon.utils import reverse_bugfix
|
||||||
|
|
||||||
from horizon.base import Horizon, Dashboard, Panel, Workflow
|
|
||||||
|
|
||||||
register = Horizon.register
|
register = Horizon.register
|
||||||
unregister = Horizon.unregister
|
unregister = Horizon.unregister
|
||||||
get_absolute_url = Horizon.get_absolute_url
|
get_absolute_url = Horizon.get_absolute_url
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Horizon Core Requirements
|
# Horizon Core Requirements
|
||||||
Django==1.3.1
|
Django>=1.3
|
||||||
python-cloudfiles
|
python-cloudfiles
|
||||||
python-dateutil
|
python-dateutil
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user