diff --git a/apps/storage/backends/filebasedstorage.py b/apps/storage/backends/filebasedstorage.py index 7baca016a8..d6fefc810d 100644 --- a/apps/storage/backends/filebasedstorage.py +++ b/apps/storage/backends/filebasedstorage.py @@ -1,7 +1,9 @@ from django.core.files.storage import FileSystemStorage +from storage.conf.settings import FILESTORAGE_LOCATION + class FileBasedStorage(FileSystemStorage): def __init__(self, *args, **kwargs): super(FileBasedStorage, self).__init__(*args, **kwargs) - self.location='document_storage' + self.location=FILESTORAGE_LOCATION diff --git a/apps/storage/conf/settings.py b/apps/storage/conf/settings.py index 6c38bb0f29..958144d38e 100644 --- a/apps/storage/conf/settings.py +++ b/apps/storage/conf/settings.py @@ -1,7 +1,8 @@ from django.conf import settings - -GRIDFS_HOST = getattr(settings, 'STORAGE_GRIDFS_HOST', 'localhost') +GRIDFS_HOST = getattr(settings, 'STORAGE_GRIDFS_HOST', u'localhost') GRIDFS_PORT = getattr(settings, 'STORAGE_GRIDFS_PORT', 27017) GRIDFS_DATABASE_NAME = getattr(settings, 'STORAGE_GRIDFS_DATABASE_NAME', u'document_storage') + +FILESTORAGE_LOCATION = getattr(settings, 'STORAGE_FILESTORAGE_LOCATION', u'document_storage') diff --git a/settings.py b/settings.py index e0adeeaae5..33d24ff53e 100644 --- a/settings.py +++ b/settings.py @@ -202,6 +202,8 @@ LOGIN_EXEMPT_URLS = ( #STORAGE_GRIDFS_HOST = 'localhost' # or list ['host a', 'host b'] #STORAGE_GRIDFS_PORT = 27017 #STORAGE_GRIDFS_DATABASE_NAME = u'document_storage' +# Filebased +#STORAGE_FILESTORAGE_LOCATION = u'document_storage' # Usage #DOCUMENTS_PREVIEW_SIZE = '640x480'