Remove the SITE_ROOT settings variable and use Django's MEDIA_ROOT instead.

By default MEDIA_ROOT will point to a new 'media' inside Mayan's main directory.
This commit is contained in:
Roberto Rosario
2014-07-11 01:06:50 -04:00
parent 3f9adb0922
commit f2c351fbc7
6 changed files with 9 additions and 6 deletions

View File

@@ -13,6 +13,6 @@ register_settings(
module=u'django_gpg.conf.settings',
settings=[
{'name': u'KEYSERVERS', 'global_name': u'SIGNATURES_KEYSERVERS', 'default': ['pool.sks-keyservers.net'], 'description': _(u'List of keyservers to be queried for unknown keys.')},
{'name': u'GPG_HOME', 'global_name': u'SIGNATURES_GPG_HOME', 'default': os.path.join(settings.SITE_ROOT, u'gpg_home'), 'description': _(u'Home directory used to store keys as well as configuration files.')},
{'name': u'GPG_HOME', 'global_name': u'SIGNATURES_GPG_HOME', 'default': os.path.join(settings.MEDIA_ROOT, u'gpg_home'), 'description': _(u'Home directory used to store keys as well as configuration files.')},
]
)

View File

@@ -41,6 +41,6 @@ register_settings(
{'name': u'ZOOM_MIN_LEVEL', 'global_name': u'DOCUMENTS_ZOOM_MIN_LEVEL', 'default': 50, 'description': _(u'Minimum amount in percent (%) to allow user to zoom out a document page interactively.')},
{'name': u'ROTATION_STEP', 'global_name': u'DOCUMENTS_ROTATION_STEP', 'default': 90, 'description': _(u'Amount in degrees to rotate a document page per user interaction.')},
#
{'name': u'CACHE_PATH', 'global_name': u'DOCUMENTS_CACHE_PATH', 'default': os.path.join(settings.SITE_ROOT, 'image_cache'), 'exists': True},
{'name': u'CACHE_PATH', 'global_name': u'DOCUMENTS_CACHE_PATH', 'default': os.path.join(settings.MEDIA_ROOT, 'image_cache'), 'exists': True},
]
)

View File

@@ -120,7 +120,6 @@ class VirtualEnv(object):
yield self.extract_dependency(item)
def __init__(self):
self.requirements_file_path = os.path.join(settings.SITE_ROOT, 'requirements', 'production.txt')
if not PIP:
raise PIPNotFound

View File

@@ -12,6 +12,6 @@ register_settings(
{'name': u'GRIDFS_HOST', 'global_name': u'STORAGE_GRIDFS_HOST', 'default': u'localhost'},
{'name': u'GRIDFS_PORT', 'global_name': u'STORAGE_GRIDFS_PORT', 'default': 27017},
{'name': u'GRIDFS_DATABASE_NAME', 'global_name': u'STORAGE_GRIDFS_DATABASE_NAME', 'default': u'document_storage'},
{'name': u'FILESTORAGE_LOCATION', 'global_name': u'STORAGE_FILESTORAGE_LOCATION', 'default': os.path.join(settings.SITE_ROOT, u'document_storage'), 'exists': True},
{'name': u'FILESTORAGE_LOCATION', 'global_name': u'STORAGE_FILESTORAGE_LOCATION', 'default': os.path.join(settings.MEDIA_ROOT, u'document_storage'), 'exists': True},
]
)

2
mayan/media/README Normal file
View File

@@ -0,0 +1,2 @@
User files such as: document_storage, image_cache, db.sqlite3 and gpg_home go here

View File

@@ -14,7 +14,9 @@ import sys
_file_path = os.path.abspath(os.path.dirname(__file__)).split('/')
BASE_DIR = SITE_ROOT = '/'.join(_file_path[0:-2])
BASE_DIR = '/'.join(_file_path[0:-2])
MEDIA_ROOT = os.path.join(BASE_DIR, 'mayan', 'media')
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
@@ -118,7 +120,7 @@ WSGI_APPLICATION = 'mayan.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(SITE_ROOT, 'db.sqlite3'),
'NAME': os.path.join(MEDIA_ROOT, 'db.sqlite3'),
}
}