src/ldt/ldt/settings.py
author grandjoncl
Thu, 18 Oct 2012 10:42:44 +0200
changeset 860 9f20aab419de
parent 853 ca39a8cf816f
child 872 cd56949a3510
permissions -rw-r--r--
Images and templates for the error pages
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',
718
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
    23
    'haystack',
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    24
    'ldt',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    25
    'ldt.core',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    26
    'ldt.ldt_utils',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    27
    'ldt.text',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    28
    'ldt.user',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    29
    'ldt.management',
718
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
    30
    'ldt.indexation',
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    31
    'oauth_provider',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    32
    'django_openid_consumer',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    33
    'piston',
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    34
    'social_auth',
136
37496f2c1fa9 Merge with 01f6e48255f7501febec8c132308243fb36a476d
ymh <ymh.work@gmail.com>
parents: 111 135
diff changeset
    35
    'south',
228
94fdb72b7d56 Users can add their own groups
verrierj
parents: 177
diff changeset
    36
    'guardian',
314
1a8620e5ebb0 Add memcached and sorl thumbnail pour thumbnail management. Set default pict on content, project and user.
cavaliet
parents: 247
diff changeset
    37
    'sorl.thumbnail',
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    38
)
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    39
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    40
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
    41
    '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
    42
    '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
    43
    '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
    44
    '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
    45
    '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
    46
    '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
    47
    '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
    48
    '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
    49
    '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
    50
    'django_openid_consumer.middleware.OpenIDMiddleware',
169
64f24f8841ec Add profile to user
verrierj
parents: 161
diff changeset
    51
    '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
    52
    '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
    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
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    56
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    57
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
    58
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
    59
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
    60
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
    61
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
    62
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
    63
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
    64
MANAGERS = settings.MANAGERS
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    65
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
    66
LANGUAGES = settings.LANGUAGES
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    67
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
    68
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
    69
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
    70
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
    71
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
    72
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
    73
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
    74
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    75
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
    76
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    77
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
    78
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
    79
LDT_MAX_SEARCH_NUMBER = 50
176
a88714473302 Added a page to display search results
verrierj
parents: 169
diff changeset
    80
LDT_MAX_FRAGMENT_PER_SEARCH = 3
177
32fbed79d3a1 Display search results on multiple pages
verrierj
parents: 176
diff changeset
    81
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
    82
LDT_JSON_DEFAULT_INDENT = 2
644
94429061bbfa First step of pagination for contents and projet in workspace home.
cavaliet
parents: 552
diff changeset
    83
LDT_MAX_CONTENTS_PER_PAGE = 10
94429061bbfa First step of pagination for contents and projet in workspace home.
cavaliet
parents: 552
diff changeset
    84
LDT_MAX_PROJECTS_PER_PAGE = 10
740
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 718
diff changeset
    85
LDT_FRONT_MEDIA_PER_PAGE = 9
111
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    86
4535dafa6007 improve releasing of resources when indexing + convert line endings to unix
ymh <ymh.work@gmail.com>
parents: 106
diff changeset
    87
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
    88
169
64f24f8841ec Add profile to user
verrierj
parents: 161
diff changeset
    89
WEB_VERSION = getattr(settings, 'WEB_VERSION', '')
228
94fdb72b7d56 Users can add their own groups
verrierj
parents: 177
diff changeset
    90
ANONYOUS_USER_ID = -1
242
bee98775a8e8 Clean code of SafeManager
verrierj
parents: 228
diff changeset
    91
USE_GROUP_PERMISSIONS = ['Project', 'Content'] 
247
f98f1a6e15f1 Add a group to contain published projects
verrierj
parents: 242
diff changeset
    92
PUBLIC_GROUP_NAME = 'everyone'
169
64f24f8841ec Add profile to user
verrierj
parents: 161
diff changeset
    93
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
    94
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
    95
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
    96
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
    97
DEFAULT_GROUP_ICON = "thumbnails/groups/group_default_icon.png"
552
6fbf608bd2a7 put external stream in settings
ymh <ymh.work@gmail.com>
parents: 332
diff changeset
    98
853
ca39a8cf816f force tagging tag length field to be 255.
ymh <ymh.work@gmail.com>
parents: 852
diff changeset
    99
# force settings value
ca39a8cf816f force tagging tag length field to be 255.
ymh <ymh.work@gmail.com>
parents: 852
diff changeset
   100
if(not hasattr(settings, 'MAX_TAG_LENGTH') or getattr(settings, 'MAX_TAG_LENGTH') > 255):
ca39a8cf816f force tagging tag length field to be 255.
ymh <ymh.work@gmail.com>
parents: 852
diff changeset
   101
    setattr(settings, 'MAX_TAG_LENGTH', 255)
852
393bcc75d26a solve pb with logging and tags
ymh <ymh.work@gmail.com>
parents: 764
diff changeset
   102
764
b059300340aa Upgraded Metadataplayer to add Vimeo support
veltr
parents: 740
diff changeset
   103
EXTERNAL_STREAM_SRC = getattr(settings, 'EXTERNAL_STREAM_SRC', ['youtube.com', 'dailymotion.com', 'vimeo.com'])
718
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   104
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   105
HAYSTACK_CONNECTIONS = {
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   106
    'default': {
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   107
        'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   108
    },
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   109
}