summaryrefslogtreecommitdiffstats
path: root/askbot/startup_procedures.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-11-09 18:00:25 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-11-09 18:00:25 -0300
commit3c23ee7178b00392f4bc2be76d6a920dc2dde901 (patch)
tree133c4d6a1034d8b9fc66c53113beb07ae9b1fae8 /askbot/startup_procedures.py
parente9541d7227cb04edf4471ff70bb51b93f817ff48 (diff)
parent7c0533bae490449ad9180ed00e3ceb876a2fbda9 (diff)
downloadaskbot-3c23ee7178b00392f4bc2be76d6a920dc2dde901.tar.gz
askbot-3c23ee7178b00392f4bc2be76d6a920dc2dde901.tar.bz2
askbot-3c23ee7178b00392f4bc2be76d6a920dc2dde901.zip
merded Adolfos branch
Diffstat (limited to 'askbot/startup_procedures.py')
-rw-r--r--askbot/startup_procedures.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
index 36da362a..3d6c4165 100644
--- a/askbot/startup_procedures.py
+++ b/askbot/startup_procedures.py
@@ -34,7 +34,7 @@ def format_as_text_tuple_entries(items):
#
# *validate emails in settings.py
def test_askbot_url():
- """Tests the ASKBOT_URL setting for the
+ """Tests the ASKBOT_URL setting for the
well-formedness and raises the ImproperlyConfigured
exception, if the setting is not good.
"""
@@ -91,8 +91,8 @@ def test_middleware():
if missing_middleware_set:
error_message = """\n\nPlease add the following middleware (listed after this message)
-to the MIDDLEWARE_CLASSES variable in your site settings.py file.
-The order the middleware records may be important, please take a look at the example in
+to the MIDDLEWARE_CLASSES variable in your site settings.py file.
+The order the middleware records may be important, please take a look at the example in
https://github.com/ASKBOT/askbot-devel/blob/master/askbot/setup_templates/settings.py:\n\n"""
middleware_text = format_as_text_tuple_entries(missing_middleware_set)
raise ImproperlyConfigured(PREAMBLE + error_message + middleware_text)
@@ -112,7 +112,7 @@ the list of MIDDLEWARE_CLASSES in your settings.py - these are not used any more
middleware_text = format_as_text_tuple_entries(remove_middleware_set)
raise ImproperlyConfigured(PREAMBLE + error_message + middleware_text)
-
+
def test_i18n():
"""askbot requires use of USE_I18N setting"""
@@ -124,7 +124,7 @@ def test_i18n():
)
def try_import(module_name, pypi_package_name):
- """tries importing a module and advises to install
+ """tries importing a module and advises to install
A corresponding Python package in the case import fails"""
try:
load_module(module_name)
@@ -173,20 +173,29 @@ def test_encoding():
)
def test_template_loader():
- """Sends a warning if you have an old style template
+ """Sends a warning if you have an old style template
loader that used to send a warning"""
old_template_loader = 'askbot.skins.loaders.load_template_source'
if old_template_loader in django_settings.TEMPLATE_LOADERS:
raise ImproperlyConfigured(PREAMBLE + \
"\nPlease change: \n"
- "'askbot.skins.loaders.load_template_source', to\n"
+ "'askbot.skins.loaders.load_template_source', to\n"
"'askbot.skins.loaders.filesystem_load_template_source',\n"
"in the TEMPLATE_LOADERS of your settings.py file"
)
def test_celery():
"""Tests celery settings"""
- if hasattr(django_settings, 'BROKER_BACKEND'):
+ broker_backend = getattr(django_settings, 'BROKER_BACKEND', None)
+ broker_transport = getattr(django_settings, 'BROKER_TRANSPORT', None)
+
+ if broker_backend != broker_transport:
+ raise ImproperlyConfigured(PREAMBLE + \
+ "\nPlese check that BROKER_BACKEND and BROKER_TRANSPORT have \n"
+ "then same value in your settings.py file"
+ )
+
+ if hasattr(django_settings, 'BROKER_BACKEND') and not hasattr(django_settings, 'BROKER_TRANSPORT'):
raise ImproperlyConfigured(PREAMBLE + \
"\nPlease rename setting BROKER_BACKEND to BROKER_TRANSPORT\n"
"in your settings.py file"