From a742aa5317b9ab023f38310f4aa88129be3004fb Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 15 Jan 2012 22:17:56 -0300 Subject: added default value requirement for STATICFILES_STORAGE setting --- askbot/deployment/__init__.py | 4 ++-- askbot/setup_templates/settings.py.mustache | 2 +- askbot/startup_procedures.py | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/askbot/deployment/__init__.py b/askbot/deployment/__init__.py index 6aa866cc..8832cd01 100644 --- a/askbot/deployment/__init__.py +++ b/askbot/deployment/__init__.py @@ -129,9 +129,9 @@ def deploy_askbot(directory, options): if django.VERSION[0] == 1 and django.VERSION[1] < 3: #force people install the django-staticfiles app - context['staticfiles_app'] = 'staticfiles' + context['staticfiles_app'] = '' else: - context['staticfiles_app'] = 'django.contrib.staticfiles' + context['staticfiles_app'] = "'django.contrib.staticfiles'," path_utils.deploy_into( directory, diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache index 2e82f273..3bca11ba 100644 --- a/askbot/setup_templates/settings.py.mustache +++ b/askbot/setup_templates/settings.py.mustache @@ -153,7 +153,7 @@ INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', - '{{ staticfiles_app }}', + {{ staticfiles_app }} #all of these are needed for the askbot 'django.contrib.admin', diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py index 88b717bc..65877fdf 100644 --- a/askbot/startup_procedures.py +++ b/askbot/startup_procedures.py @@ -321,6 +321,12 @@ def test_staticfiles(): 'django-staticfiles app, type\n' 'pip install --upgrade django-staticfiles' ) + if not hasattr(django_settings, 'STATICFILES_STORAGE'): + raise AskbotConfigError( + 'Configure STATICFILES_STORAGE setting as desired, ' + 'a reasonable default is\n' + "STATICFILES_STORAGE = 'staticfiles.storage.StaticFilesStorage'" + ) else: staticfiles_app_name = 'django.contrib.staticfiles' -- cgit v1.2.3-1-g7c22