src/ldt/ldt/settings.py
author verrierj
Wed, 16 Nov 2011 15:28:24 +0100
changeset 242 bee98775a8e8
parent 228 94fdb72b7d56
child 247 f98f1a6e15f1
permissions -rw-r--r--
Clean code of SafeManager
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
     1
import logging
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
     2
from django.conf import settings
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
     3
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
     4
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
     5
# EMAIL_HOST='smtp.gmail.com'
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
     6
# EMAIL_HOST_USER = 'wujingwen1112@gmail.com'
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
     7
# EMAIL_HOST_PASSWORD='jingwen1112'
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
     8
# EMAIL_PORT='587'
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
     9
# EMAIL_USE_TLS = True
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    10
#DEFAULT_FROM_EMAIL = "admin@domain.com"
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    11
#SERVER_EMAIL = "admin@domain.com"
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    12
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    13
INSTALLED_APPS = (
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    14
    'django_extensions',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    15
    'django.contrib.auth',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    16
    'django.contrib.contenttypes',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    17
    'django.contrib.sessions',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    18
    'django.contrib.sites',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    19
    'django.contrib.messages',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    20
    'django.contrib.admin',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    21
    'registration',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    22
    'tagging',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    23
    'ldt',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    24
    'ldt.core',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    25
    'ldt.ldt_utils',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    26
    'ldt.text',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    27
    'ldt.user',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    28
    'ldt.management',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    29
    'oauth_provider',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    30
    'django_openid_consumer',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    31
    'piston',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    32
    'social_auth',
136
37496f2c1fa9 Merge with 01f6e48255f7501febec8c132308243fb36a476d
ymh <ymh.work@gmail.com>
parents: 111 135
diff changeset
    33
    'south',
228
94fdb72b7d56 Users can add their own groups
verrierj
parents: 177
diff changeset
    34
    'guardian',
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    35
)
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    36
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    37
MIDDLEWARE_CLASSES = (
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    38
    'django.middleware.common.CommonMiddleware',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    39
    'ldt.ldt_utils.middleware.swfupload.SWFUploadMiddleware',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    40
    'django.contrib.sessions.middleware.SessionMiddleware',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    41
    'django.middleware.csrf.CsrfViewMiddleware',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    42
    'django.contrib.auth.middleware.AuthenticationMiddleware',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    43
    'django.middleware.locale.LocaleMiddleware',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    44
    'django.contrib.messages.middleware.MessageMiddleware',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    45
    'django_openid_consumer.middleware.OpenIDMiddleware',
169
64f24f8841ec Add profile to user
verrierj
parents: 161
diff changeset
    46
    'ldt.ldt_utils.middleware.userprofile.LanguageMiddleware',
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    47
)
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    48
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    49
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    50
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    51
WEB_URL = getattr(settings, 'WEB_URL', '')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    52
BASE_URL = getattr(settings, 'BASE_URL', '')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    53
STATIC_URL = getattr(settings, 'STATIC_URL', '')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    54
MEDIA_URL = getattr(settings, 'MEDIA_URL', '')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    55
MEDIA_ROOT = getattr(settings, 'MEDIA_ROOT', '')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    56
SITE_ID = getattr(settings, 'SITE_ID', 1)
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    57
DEBUG = getattr(settings, 'DEBUG', True)
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    58
MANAGERS = settings.MANAGERS
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    59
INSTALLED_APPS = settings.INSTALLED_APPS
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    60
LANGUAGES = settings.LANGUAGES
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    61
DECOUPAGE_BLACKLIST = getattr(settings, 'DECOUPAGE_BLACKLIST', 'de_PPP')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    62
STREAM_URL = getattr(settings, 'STREAM_URL', '')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    63
STREAM_PATH = getattr(settings, 'STREAM_PATH', '')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    64
STREAM_SRC_PREFIX = getattr(settings, 'STREAM_SRC_PREFIX', '')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    65
LOG_FILE = getattr(settings, 'LOG_FILE', '')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    66
LOG_LEVEL = getattr(settings, 'LOG_LEVEL', logging.INFO)
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    67
EMPTY_MEDIA_EXTERNALID = getattr(settings, 'EMPTY_MEDIA_EXTERNALID', None)
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    68
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    69
GLOBAL_LOG_LEVEL = LOG_LEVEL
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    70
GLOBAL_LOG_HANDLERS = [logging.FileHandler(LOG_FILE)]
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    71
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    72
TEST_WEBSERVER_ADDRPORT = getattr(settings, 'TEST_WEBSERVER_ADDRPORT', '127.0.0.1:8000')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    73
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    74
ACCOUNT_ACTIVATION_DAYS = getattr(settings, 'ACCOUNT_ACTIVATION_DAYS', 7)
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    75
LDT_MEDIA_PREFIX = getattr(settings, 'LDT_MEDIA_PREFIX', MEDIA_URL + 'ldt/')
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    76
LDT_MAX_SEARCH_NUMBER = 50
176
a88714473302 Added a page to display search results
verrierj
parents: 169
diff changeset
    77
LDT_MAX_FRAGMENT_PER_SEARCH = 3
177
32fbed79d3a1 Display search results on multiple pages
verrierj
parents: 176
diff changeset
    78
LDT_RESULTS_PER_PAGE = 1
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    79
LDT_JSON_DEFAULT_INDENT = 2
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    80
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    81
AUTO_INDEX_AFTER_SAVE = getattr(settings, 'AUTO_INDEX_AFTER_SAVE', True)
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    82
169
64f24f8841ec Add profile to user
verrierj
parents: 161
diff changeset
    83
WEB_VERSION = getattr(settings, 'WEB_VERSION', '')
228
94fdb72b7d56 Users can add their own groups
verrierj
parents: 177
diff changeset
    84
ANONYOUS_USER_ID = -1
242
bee98775a8e8 Clean code of SafeManager
verrierj
parents: 228
diff changeset
    85
USE_GROUP_PERMISSIONS = ['Project', 'Content'] 
169
64f24f8841ec Add profile to user
verrierj
parents: 161
diff changeset
    86
64f24f8841ec Add profile to user
verrierj
parents: 161
diff changeset
    87