Merge branch 'master' into feature/tornado
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
try:
|
||||
from .local import * # NOQA
|
||||
except ImportError:
|
||||
except ImportError as exception:
|
||||
if force_text(exception) != 'No module named local' and force_text(exception) != 'No module named \'mayan.settings.local\'':
|
||||
raise
|
||||
from .base import * # NOQA
|
||||
|
||||
@@ -1,36 +1,38 @@
|
||||
"""
|
||||
Django settings for Mayan EDMS project.
|
||||
Django settings for mayan10 project.
|
||||
|
||||
Generated by 'django-admin startproject' using Django 1.10.4.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/1.6/topics/settings/
|
||||
https://docs.djangoproject.com/en/1.10/topics/settings/
|
||||
|
||||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/1.6/ref/settings/
|
||||
https://docs.djangoproject.com/en/1.10/ref/settings/
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
import os
|
||||
import sys
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
_file_path = os.path.abspath(os.path.dirname(__file__)).split('/')
|
||||
import mayan
|
||||
|
||||
BASE_DIR = '/'.join(_file_path[0:-2])
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'mayan', 'media')
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
|
||||
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'secret_key_missing'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
DEBUG = False
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
# Application definition
|
||||
|
||||
@@ -55,9 +57,8 @@ INSTALLED_APPS = (
|
||||
'compressor',
|
||||
'corsheaders',
|
||||
'djcelery',
|
||||
'filetransfers',
|
||||
'formtools',
|
||||
'kombu.transport.django',
|
||||
'mathfilters',
|
||||
'mptt',
|
||||
'pure_pagination',
|
||||
'rest_framework',
|
||||
@@ -80,31 +81,37 @@ INSTALLED_APPS = (
|
||||
'smart_settings',
|
||||
'user_management',
|
||||
# Mayan EDMS
|
||||
'cabinets',
|
||||
'checkouts',
|
||||
'document_comments',
|
||||
'document_indexing',
|
||||
'document_parsing',
|
||||
'document_signatures',
|
||||
'document_states',
|
||||
'documents',
|
||||
'events',
|
||||
'folders',
|
||||
'installation',
|
||||
# Disable the folders app by default
|
||||
# Will be removed in the next version
|
||||
# 'folders',
|
||||
'linking',
|
||||
'mailer',
|
||||
'mayan_statistics',
|
||||
'metadata',
|
||||
'mirroring',
|
||||
'motd',
|
||||
'ocr',
|
||||
'rest_api',
|
||||
'sources',
|
||||
'statistics',
|
||||
'storage',
|
||||
'tags',
|
||||
'task_manager',
|
||||
# Placed after rest_api to allow template overriding
|
||||
'rest_framework_swagger',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
'common.middleware.error_logging.ErrorLoggingMiddleware',
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'corsheaders.middleware.CorsMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
@@ -120,10 +127,32 @@ MIDDLEWARE_CLASSES = (
|
||||
|
||||
ROOT_URLCONF = 'mayan.urls'
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
'django.template.context_processors.debug',
|
||||
'django.template.context_processors.i18n',
|
||||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
],
|
||||
'loaders': [
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader'
|
||||
]
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
WSGI_APPLICATION = 'mayan.wsgi.application'
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
|
||||
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
|
||||
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
@@ -132,8 +161,26 @@ DATABASES = {
|
||||
}
|
||||
}
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
|
||||
|
||||
AUTH_PASSWORD_VALIDATORS = [
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
||||
},
|
||||
{
|
||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
||||
},
|
||||
]
|
||||
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/1.6/topics/i18n/
|
||||
# https://docs.djangoproject.com/en/1.10/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
|
||||
@@ -145,15 +192,17 @@ USE_L10N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/1.10/howto/static-files/
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
# ------------ Custom settings section ----------
|
||||
|
||||
TEMPLATE_DEBUG = True
|
||||
PROJECT_TITLE = 'Mayan EDMS'
|
||||
PROJECT_NAME = 'mayan'
|
||||
PROJECT_TITLE = mayan.__title__
|
||||
PROJECT_WEBSITE = 'http://www.mayan-edms.com'
|
||||
PROJECT_COPYRIGHT = mayan.__copyright__
|
||||
PROJECT_LICENSE = mayan.__license__
|
||||
|
||||
LANGUAGES = (
|
||||
('ar', _('Arabic')),
|
||||
@@ -183,30 +232,18 @@ LANGUAGES = (
|
||||
|
||||
SITE_ID = 1
|
||||
|
||||
sys.path.append(os.path.join(BASE_DIR, 'mayan', 'apps'))
|
||||
sys.path.append(os.path.join(BASE_DIR, 'apps'))
|
||||
|
||||
STATIC_ROOT = os.path.join(MEDIA_ROOT, 'static')
|
||||
|
||||
# List of callables that know how to import templates from various sources.
|
||||
TEMPLATE_LOADERS = (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader'
|
||||
)
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.core.context_processors.debug',
|
||||
'django.core.context_processors.i18n',
|
||||
'django.core.context_processors.request',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
)
|
||||
|
||||
STATICFILES_FINDERS = (
|
||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||
'compressor.finders.CompressorFinder',
|
||||
)
|
||||
|
||||
TEST_RUNNER = 'common.tests.runner.MayanTestRunner'
|
||||
|
||||
# --------- Django compressor -------------
|
||||
COMPRESS_CSS_FILTERS = (
|
||||
'compressor.filters.css_default.CssAbsoluteFilter',
|
||||
@@ -221,9 +258,9 @@ INTERNAL_IPS = ('127.0.0.1',)
|
||||
# ---------- Django REST framework -----------
|
||||
REST_FRAMEWORK = {
|
||||
'DEFAULT_AUTHENTICATION_CLASSES': (
|
||||
'rest_framework.authentication.BasicAuthentication',
|
||||
'rest_framework.authentication.TokenAuthentication',
|
||||
'rest_framework.authentication.SessionAuthentication',
|
||||
'rest_framework.authentication.TokenAuthentication',
|
||||
'rest_framework.authentication.BasicAuthentication',
|
||||
),
|
||||
'PAGE_SIZE': 10,
|
||||
}
|
||||
@@ -245,18 +282,17 @@ CELERY_ROUTES = {}
|
||||
CELERY_TASK_SERIALIZER = 'json'
|
||||
CELERY_TIMEZONE = 'UTC'
|
||||
CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'
|
||||
TEST_RUNNER = 'djcelery.contrib.test_runner.CeleryTestSuiteRunner'
|
||||
# ------------ CORS ------------
|
||||
CORS_ORIGIN_ALLOW_ALL = True
|
||||
# ------ Django REST Swagger -----
|
||||
SWAGGER_SETTINGS = {
|
||||
'api_version': '1',
|
||||
'info': {
|
||||
'title': _('Mayan EDMS API Documentation'),
|
||||
'description': _('Free Open Source Document Management System.'),
|
||||
'contact': 'roberto.rosario@mayan-edms.com',
|
||||
'license': 'Apache 2.0',
|
||||
'licenseUrl': 'http://www.apache.org/licenses/LICENSE-2.0.html'
|
||||
'title': _('Mayan EDMS API Documentation'),
|
||||
'description': _('Free Open Source Document Management System.'),
|
||||
'contact': 'roberto.rosario@mayan-edms.com',
|
||||
'license': 'Apache 2.0',
|
||||
'licenseUrl': 'http://www.apache.org/licenses/LICENSE-2.0.html'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,13 +3,12 @@ from __future__ import absolute_import, unicode_literals
|
||||
from . import * # NOQA
|
||||
|
||||
DEBUG = True
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
TEMPLATE_LOADERS = (
|
||||
TEMPLATES[0]['OPTIONS']['loaders'] = (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader'
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
)
|
||||
|
||||
INSTALLED_APPS += (
|
||||
|
||||
@@ -2,17 +2,17 @@ from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from . import * # NOQA
|
||||
|
||||
DEBUG = False
|
||||
|
||||
# Update this accordingly;
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
TEMPLATE_LOADERS = (
|
||||
('django.template.loaders.cached.Loader', (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
)),
|
||||
TEMPLATES[0]['OPTIONS']['loaders'] = (
|
||||
(
|
||||
'django.template.loaders.cached.Loader', (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
)
|
||||
),
|
||||
)
|
||||
|
||||
CELERY_ALWAYS_EAGER = False
|
||||
|
||||
1
mayan/settings/staging/__init__.py
Normal file
1
mayan/settings/staging/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .base import * # NOQA
|
||||
16
mayan/settings/staging/docker.py
Normal file
16
mayan/settings/staging/docker.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from ..production import * # NOQA
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'postgres',
|
||||
'USER': 'postgres',
|
||||
'HOST': 'localhost',
|
||||
'PORT': '5432',
|
||||
}
|
||||
}
|
||||
|
||||
BROKER_URL = 'redis://127.0.0.1:6379/0'
|
||||
CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/0'
|
||||
@@ -1,9 +1,9 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from ..base import * # NOQA
|
||||
from .. import * # NOQA
|
||||
|
||||
INSTALLED_APPS += ('test_without_migrations',)
|
||||
TEMPLATE_LOADERS = (
|
||||
TEMPLATES[0]['OPTIONS']['loaders'] = (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader'
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
)
|
||||
|
||||
13
mayan/settings/testing/db_mysql.py
Normal file
13
mayan/settings/testing/db_mysql.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .base import * # NOQA
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'NAME': 'mayan_edms',
|
||||
'USER': 'root',
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '3306',
|
||||
}
|
||||
}
|
||||
1
mayan/settings/testing/docker/__init__.py
Normal file
1
mayan/settings/testing/docker/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .base import * # NOQA
|
||||
6
mayan/settings/testing/docker/base.py
Normal file
6
mayan/settings/testing/docker/base.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from ..base import * # NOQA
|
||||
|
||||
SIGNATURES_GPG_PATH = '/usr/bin/gpg1'
|
||||
|
||||
13
mayan/settings/testing/docker/db_mysql.py
Normal file
13
mayan/settings/testing/docker/db_mysql.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .base import * # NOQA
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'NAME': 'mayan',
|
||||
'USER': 'root',
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '3306',
|
||||
}
|
||||
}
|
||||
14
mayan/settings/testing/docker/db_oracle.py
Normal file
14
mayan/settings/testing/docker/db_oracle.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .base import * # NOQA
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.oracle',
|
||||
'NAME': 'xe',
|
||||
'USER': 'system',
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '49161',
|
||||
'PASSWORD': 'oracle',
|
||||
}
|
||||
}
|
||||
13
mayan/settings/testing/docker/db_postgres.py
Normal file
13
mayan/settings/testing/docker/db_postgres.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from .base import * # NOQA
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'postgres',
|
||||
'USER': 'postgres',
|
||||
'HOST': 'localhost',
|
||||
'PORT': '5432',
|
||||
}
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
from ..base import * # NOQA
|
||||
from .base import * # NOQA
|
||||
|
||||
SIGNATURES_GPG_PATH = '/usr/bin/gpg1'
|
||||
|
||||
5
mayan/settings/testing/gitlab-ci/base.py
Normal file
5
mayan/settings/testing/gitlab-ci/base.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from ..base import * # NOQA
|
||||
|
||||
SIGNATURES_GPG_PATH = '/usr/bin/gpg1'
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from ..base import * # NOQA
|
||||
from .base import * # NOQA
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from ..base import * # NOQA
|
||||
from .base import * # NOQA
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
|
||||
Reference in New Issue
Block a user