diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-11-09 18:00:25 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-11-09 18:00:25 -0300 |
commit | 3c23ee7178b00392f4bc2be76d6a920dc2dde901 (patch) | |
tree | 133c4d6a1034d8b9fc66c53113beb07ae9b1fae8 | |
parent | e9541d7227cb04edf4471ff70bb51b93f817ff48 (diff) | |
parent | 7c0533bae490449ad9180ed00e3ceb876a2fbda9 (diff) | |
download | askbot-3c23ee7178b00392f4bc2be76d6a920dc2dde901.tar.gz askbot-3c23ee7178b00392f4bc2be76d6a920dc2dde901.tar.bz2 askbot-3c23ee7178b00392f4bc2be76d6a920dc2dde901.zip |
merded Adolfos branch
-rw-r--r-- | askbot/setup_templates/settings.py | 2 | ||||
-rw-r--r-- | askbot/setup_templates/settings.py.mustache | 5 | ||||
-rw-r--r-- | askbot/startup_procedures.py | 25 |
3 files changed, 21 insertions, 11 deletions
diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py index 52a047c5..ed5c30da 100644 --- a/askbot/setup_templates/settings.py +++ b/askbot/setup_templates/settings.py @@ -215,5 +215,5 @@ CELERY_ALWAYS_EAGER = True import djcelery djcelery.setup_loader() -CSRF_COOKIE_NAME = 'askbot_scrf' +CSRF_COOKIE_NAME = 'askbot_csrf' CSRF_COOKIE_DOMAIN = ''#enter domain name here - e.g. example.com diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache index f712a5cb..fa0b20d0 100644 --- a/askbot/setup_templates/settings.py.mustache +++ b/askbot/setup_templates/settings.py.mustache @@ -213,6 +213,7 @@ CELERY_ALWAYS_EAGER = True import djcelery djcelery.setup_loader() +DOMAIN_NAME = '{{domain_name}}' -CSRF_COOKIE_NAME = '{{domain_name}}_scrf' -CSRF_COOKIE_DOMAIN = '{{domain_name}}'#enter domain name here - e.g. example.com +CSRF_COOKIE_NAME = '{{domain_name}}_csrf' +CSRF_COOKIE_DOMAIN = DOMAIN_NAME 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" |