From 811995a27ea0a5a6742b5976c91ad3156c1c5ac3 Mon Sep 17 00:00:00 2001 From: Piotr Mitros Date: Mon, 30 Jan 2012 16:43:17 -0500 Subject: [PATCH] Changes needed for Askbot S3 --- settings_new_askbot.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/settings_new_askbot.py b/settings_new_askbot.py index eebdf6d653..347f851b78 100644 --- a/settings_new_askbot.py +++ b/settings_new_askbot.py @@ -34,6 +34,10 @@ HTTPS = 'on' MEDIA_URL = '' MEDIA_ROOT = '' +# Needed for Askbot +# Deployed machines: Move to S3 +DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' + DEBUG = True TEMPLATE_DEBUG = DEBUG @@ -251,13 +255,15 @@ import site STATICFILES_DIRS = STATICFILES_DIRS + ( ASKBOT_DIR+'/askbot/skins',) -# Needed for Askbot -# Critical TODO: Move to S3 -MEDIA_URL = '/discussion/upfiles/' -MEDIA_ROOT = ASKBOT_DIR+'/askbot/upfiles' - ASKBOT_ROOT = os.path.dirname(askbot.__file__) +# Needed for Askbot +# Deployed machines: Move to S3 +if MEDIA_ROOT == '': + MEDIA_ROOT = ASKBOT_DIR+'/askbot/upfiles' +if MEDIA_URL == '': + MEDIA_URL = '/discussion/upfiles/' + site.addsitedir(os.path.join(os.path.dirname(askbot.__file__), 'deps')) TEMPLATE_LOADERS = TEMPLATE_LOADERS + ('askbot.skins.loaders.filesystem_load_template_source',) @@ -281,7 +287,6 @@ FILE_UPLOAD_HANDLERS = ( ASKBOT_ALLOWED_UPLOAD_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff') ASKBOT_MAX_UPLOAD_FILE_SIZE = 1024 * 1024 #result in bytes # ASKBOT_FILE_UPLOAD_DIR = os.path.join(os.path.dirname(__file__), 'askbot', 'upfiles') -DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' PROJECT_ROOT = os.path.dirname(__file__)