prepend storage name to differentiate config options

This commit is contained in:
Roberto Rosario
2011-03-07 23:43:07 -04:00
parent 6293a35926
commit 3774a2cb5a
2 changed files with 3 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ from storage.conf import settings
class GridFSStorage(Storage):
def __init__(self, *args, **kwargs):
self.db = Connection(host=settings.GRIDFS_HOST,
port=settings.GRIDFS_PORT)[settings.DATABASE_NAME]
port=settings.GRIDFS_PORT)[settings.GRIDFS_DATABASE_NAME]
self.fs = GridFS(self.db)

View File

@@ -1,6 +1,7 @@
from django.conf import settings
GRIDFS_HOST = getattr(settings, 'STORAGE_GRIDFS_HOST', 'localhost')
GRIDFS_PORT = getattr(settings, 'STORAGE_GRIDFS_PORT', 27017)
DATABASE_NAME = getattr(settings, 'STORAGE_GRIDFS_DATABASE_NAME', u'document_storage')
GRIDFS_DATABASE_NAME = getattr(settings, 'STORAGE_GRIDFS_DATABASE_NAME', u'document_storage')