src/ldt/ldt/settings.py
author verrierj
Wed, 18 Jan 2012 16:29:02 +0100
changeset 415 4236f99104ba
parent 332 c28d4dc49a50
child 447 91d87f958a16
child 552 6fbf608bd2a7
permissions -rw-r--r--
Annotation-types title are found in search API
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',
314
1a8620e5ebb0 Add memcached and sorl thumbnail pour thumbnail management. Set default pict on content, project and user.
cavaliet
parents: 247
diff changeset
    35
    'sorl.thumbnail',
111
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
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    38
MIDDLEWARE_CLASSES = (
314
1a8620e5ebb0 Add memcached and sorl thumbnail pour thumbnail management. Set default pict on content, project and user.
cavaliet
parents: 247
diff changeset
    39
    'django.middleware.cache.UpdateCacheMiddleware',
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    40
    'django.middleware.common.CommonMiddleware',
314
1a8620e5ebb0 Add memcached and sorl thumbnail pour thumbnail management. Set default pict on content, project and user.
cavaliet
parents: 247
diff changeset
    41
    'django.middleware.cache.FetchFromCacheMiddleware',
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    42
    '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
    43
    '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
    44
    '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
    45
    '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
    46
    '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
    47
    '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
    48
    'django_openid_consumer.middleware.OpenIDMiddleware',
169
64f24f8841ec Add profile to user
verrierj
parents: 161
diff changeset
    49
    'ldt.ldt_utils.middleware.userprofile.LanguageMiddleware',
332
c28d4dc49a50 add API interface to add annotation, with an ajax example in the comment.
cavaliet
parents: 330
diff changeset
    50
    'ldt.api.middleware.pistonput.PistonPutMiddleware',
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    51
)
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    52
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    53
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    54
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    55
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
    56
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
    57
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
    58
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
    59
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
    60
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
    61
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
    62
MANAGERS = settings.MANAGERS
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    63
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
    64
LANGUAGES = settings.LANGUAGES
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    65
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
    66
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
    67
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
    68
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
    69
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
    70
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
    71
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
    72
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    73
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
    74
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
    75
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    76
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
    77
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    78
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
    79
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
    80
LDT_MAX_SEARCH_NUMBER = 50
176
a88714473302 Added a page to display search results
verrierj
parents: 169
diff changeset
    81
LDT_MAX_FRAGMENT_PER_SEARCH = 3
177
32fbed79d3a1 Display search results on multiple pages
verrierj
parents: 176
diff changeset
    82
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
    83
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
    84
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    85
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
    86
169
64f24f8841ec Add profile to user
verrierj
parents: 161
diff changeset
    87
WEB_VERSION = getattr(settings, 'WEB_VERSION', '')
228
94fdb72b7d56 Users can add their own groups
verrierj
parents: 177
diff changeset
    88
ANONYOUS_USER_ID = -1
242
bee98775a8e8 Clean code of SafeManager
verrierj
parents: 228
diff changeset
    89
USE_GROUP_PERMISSIONS = ['Project', 'Content'] 
247
f98f1a6e15f1 Add a group to contain published projects
verrierj
parents: 242
diff changeset
    90
PUBLIC_GROUP_NAME = 'everyone'
169
64f24f8841ec Add profile to user
verrierj
parents: 161
diff changeset
    91
330
806188af5027 Projects have an icon identical to one of the media they contain, if this icon is different from the default icon. Icons can be set using ./manage.py setprojecticon once icons have been added to contents.
verrierj
parents: 314
diff changeset
    92
DEFAULT_CONTENT_ICON = "thumbnails/contents/content_default_icon.png"
806188af5027 Projects have an icon identical to one of the media they contain, if this icon is different from the default icon. Icons can be set using ./manage.py setprojecticon once icons have been added to contents.
verrierj
parents: 314
diff changeset
    93
DEFAULT_PROJECT_ICON = "thumbnails/projects/project_default_icon.png"
806188af5027 Projects have an icon identical to one of the media they contain, if this icon is different from the default icon. Icons can be set using ./manage.py setprojecticon once icons have been added to contents.
verrierj
parents: 314
diff changeset
    94
DEFAULT_USER_ICON = "thumbnails/users/user_default_icon.png"
806188af5027 Projects have an icon identical to one of the media they contain, if this icon is different from the default icon. Icons can be set using ./manage.py setprojecticon once icons have been added to contents.
verrierj
parents: 314
diff changeset
    95
DEFAULT_GROUP_ICON = "thumbnails/groups/group_default_icon.png"