Added configurable location setting for file based storage
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user