|
@@ -29,12 +29,12 @@ from guppy import hpy
|
|
|
|
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
|
|
|
|
-import desktop.conf
|
|
|
|
|
-import desktop.log
|
|
|
|
|
import desktop.redaction
|
|
import desktop.redaction
|
|
|
from desktop.lib.paths import get_desktop_root
|
|
from desktop.lib.paths import get_desktop_root
|
|
|
from desktop.lib.python_util import force_dict_to_strings
|
|
from desktop.lib.python_util import force_dict_to_strings
|
|
|
|
|
|
|
|
|
|
+from aws.conf import is_default_configured as is_s3_enabled
|
|
|
|
|
+
|
|
|
|
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
|
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), '..', '..', '..'))
|
|
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), '..', '..', '..'))
|
|
@@ -228,14 +228,6 @@ LOGOUT_REDIRECT_URL = "/" # For djangosaml2 bug.
|
|
|
|
|
|
|
|
PYLINTRC = get_desktop_root('.pylintrc')
|
|
PYLINTRC = get_desktop_root('.pylintrc')
|
|
|
|
|
|
|
|
-# Insert our custom upload handlers
|
|
|
|
|
-FILE_UPLOAD_HANDLERS = (
|
|
|
|
|
- 'aws.s3.upload.S3FileUploadHandler',
|
|
|
|
|
- 'hadoop.fs.upload.HDFSfileUploadHandler',
|
|
|
|
|
- 'django.core.files.uploadhandler.MemoryFileUploadHandler',
|
|
|
|
|
- 'django.core.files.uploadhandler.TemporaryFileUploadHandler',
|
|
|
|
|
-)
|
|
|
|
|
-
|
|
|
|
|
# Custom CSRF Failure View
|
|
# Custom CSRF Failure View
|
|
|
CSRF_FAILURE_VIEW = 'desktop.views.csrf_failure'
|
|
CSRF_FAILURE_VIEW = 'desktop.views.csrf_failure'
|
|
|
|
|
|
|
@@ -440,6 +432,23 @@ if desktop.conf.SECURE_PROXY_SSL_HEADER.get():
|
|
|
if 'useradmin' in [app.name for app in appmanager.DESKTOP_APPS]:
|
|
if 'useradmin' in [app.name for app in appmanager.DESKTOP_APPS]:
|
|
|
MIDDLEWARE_CLASSES.append('useradmin.middleware.LastActivityMiddleware')
|
|
MIDDLEWARE_CLASSES.append('useradmin.middleware.LastActivityMiddleware')
|
|
|
|
|
|
|
|
|
|
+################################################################
|
|
|
|
|
+# Register file upload handlers
|
|
|
|
|
+# This section must go after the desktop lib modules are loaded
|
|
|
|
|
+################################################################
|
|
|
|
|
+
|
|
|
|
|
+# Insert our custom upload handlers
|
|
|
|
|
+file_upload_handlers = [
|
|
|
|
|
+ 'hadoop.fs.upload.HDFSfileUploadHandler',
|
|
|
|
|
+ 'django.core.files.uploadhandler.MemoryFileUploadHandler',
|
|
|
|
|
+ 'django.core.files.uploadhandler.TemporaryFileUploadHandler',
|
|
|
|
|
+]
|
|
|
|
|
+
|
|
|
|
|
+if is_s3_enabled():
|
|
|
|
|
+ file_upload_handlers.insert(0, 'aws.s3.upload.S3FileUploadHandler')
|
|
|
|
|
+
|
|
|
|
|
+FILE_UPLOAD_HANDLERS = tuple(file_upload_handlers)
|
|
|
|
|
+
|
|
|
############################################################
|
|
############################################################
|
|
|
|
|
|
|
|
# Necessary for South to not fuzz with tests. Fixed in South 0.7.1
|
|
# Necessary for South to not fuzz with tests. Fixed in South 0.7.1
|