[dropbox] Move settings to the class level to ease subclassing
* Update dropbox.py
Added settings parameters as in s3boto3.py that way its easier to modify them when creating a  subclass
* Update dropbox.py
@@ -66,17 +66,18 @@ class DropBoxFile(File):
@deconstructible
class DropBoxStorage(Storage):
"""DropBox Storage class for Django pluggable storage system."""
+ location = setting('DROPBOX_ROOT_PATH', '/')
+ oauth2_access_token = setting('DROPBOX_OAUTH2_TOKEN')
+ timeout = setting('DROPBOX_TIMEOUT', _DEFAULT_TIMEOUT)
CHUNK_SIZE = 4 * 1024 * 1024
- def __init__(self, oauth2_access_token=None, root_path=None, timeout=None):
- oauth2_access_token = oauth2_access_token or setting('DROPBOX_OAUTH2_TOKEN')
+ def __init__(self, oauth2_access_token=oauth2_access_token, root_path=location, timeout=timeout):
if oauth2_access_token is None:
raise ImproperlyConfigured("You must configure an auth token at"
"'settings.DROPBOX_OAUTH2_TOKEN'.")
- self.root_path = root_path or setting('DROPBOX_ROOT_PATH', '/')
- timeout = timeout or setting('DROPBOX_TIMEOUT', _DEFAULT_TIMEOUT)
+ self.root_path = root_path
self.client = Dropbox(oauth2_access_token, timeout=timeout)
def _full_path(self, name):
