web/ldtplatform/config.py.tmpl
author ymh <ymh.work@gmail.com>
Tue, 06 Nov 2012 17:59:59 +0100
changeset 905 7be50692abb4
parent 858 dcf47b385ddd
permissions -rw-r--r--
Correct web_auth to be a list to respect regex order
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
444
2711eef17092 Update front tag list management with settings/config.
cavaliet
parents: 333
diff changeset
     1
# -*- coding: utf-8 -*-
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
import os, logging
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
SITE_ID = 1
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
769
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
     6
#BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/"
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
     7
BASE_DIR = '%(base_dir)s'
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
     8
BASE_URL = '%(base_url)s'
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
     9
WEB_URL = '%(web_url)s'
905
7be50692abb4 Correct web_auth to be a list to respect regex order
ymh <ymh.work@gmail.com>
parents: 858
diff changeset
    10
WEB_AUTH = [] # example [{'REGEX': 'localhost/~ymh/platform', 'NAME': 'ymh', 'PASSWORD': 'ymh'}]
106
2affc8a44dfb Clean static_url management, add icons and clean settings.py and config.py.tmpl management with the static urls.
cavaliet
parents: 104
diff changeset
    11
STATIC_URL = BASE_URL + 'static/site/'
2affc8a44dfb Clean static_url management, add icons and clean settings.py and config.py.tmpl management with the static urls.
cavaliet
parents: 104
diff changeset
    12
2affc8a44dfb Clean static_url management, add icons and clean settings.py and config.py.tmpl management with the static urls.
cavaliet
parents: 104
diff changeset
    13
769
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    14
STREAM_URL = "%(stream_url)s"
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
769
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    16
STREAM_SRC_PREFIX = "%(stream_src_prefix)s"
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
 
112
9886ab183b09 add permalink + corrcetion config with static and media path. update urls
ymh <ymh.work@gmail.com>
parents: 109
diff changeset
    18
BASE_STATIC_ROOT = os.path.abspath(BASE_DIR + "../static/").rstrip("/")+"/"
142
0b2f32965787 small corrections
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    19
BASE_STATIC_URL = BASE_URL + 'static/' 
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
# Absolute path to the directory that holds media.
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
# Example: "/home/media/media.lawrence.com/"
112
9886ab183b09 add permalink + corrcetion config with static and media path. update urls
ymh <ymh.work@gmail.com>
parents: 109
diff changeset
    23
MEDIA_ROOT = BASE_STATIC_ROOT + "media/"
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
104
b62a2a3e272d Use django.contrib.staticfiles to manage static file. Reorganize static files in ldt folder.
cavaliet
parents: 103
diff changeset
    26
# Absolute path to the directory that static files (js, css, swf...)
b62a2a3e272d Use django.contrib.staticfiles to manage static file. Reorganize static files in ldt folder.
cavaliet
parents: 103
diff changeset
    27
# DO NOT forget to do command line ./manage.py collectstatic to gather static media into the web/static folder
112
9886ab183b09 add permalink + corrcetion config with static and media path. update urls
ymh <ymh.work@gmail.com>
parents: 109
diff changeset
    28
STATIC_ROOT = BASE_STATIC_ROOT + "site/"
104
b62a2a3e272d Use django.contrib.staticfiles to manage static file. Reorganize static files in ldt folder.
cavaliet
parents: 103
diff changeset
    29
122
f3a013f66974 Add search form, displaying the results in a regular LDT template. Update language files.
cavaliet
parents: 112
diff changeset
    30
# PATH to the ffmpeg executable, used to know automatically the media file duration 
769
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    31
FFMPEG_PATH = "%(ffmpeg_path)s"
122
f3a013f66974 Add search form, displaying the results in a regular LDT template. Update language files.
cavaliet
parents: 112
diff changeset
    32
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
112
9886ab183b09 add permalink + corrcetion config with static and media path. update urls
ymh <ymh.work@gmail.com>
parents: 109
diff changeset
    34
CONTENT_ROOT = BASE_STATIC_ROOT + "content/"
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
106
2affc8a44dfb Clean static_url management, add icons and clean settings.py and config.py.tmpl management with the static urls.
cavaliet
parents: 104
diff changeset
    36
# PATH where uploaded media are put.
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
STREAM_PATH = CONTENT_ROOT
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
142
0b2f32965787 small corrections
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    39
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
0b2f32965787 small corrections
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    40
LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/'
0b2f32965787 small corrections
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    41
0b2f32965787 small corrections
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    42
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
DATABASES = {
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
    'default': {
769
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    46
        'ENGINE': 'django.db.backends.%(db_engine)s', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    47
        'NAME': '%(db_name)s',                      # Or path to database file if using sqlite3.
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    48
        'USER': '%(db_user)s',                      # Not used with sqlite3.
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    49
        'PASSWORD': '%(db_password)s',                  # Not used with sqlite3.
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    50
        'HOST': '%(db_host)s',                      # Set to empty string for localhost. Not used with sqlite3.
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    51
        'PORT': '%(db_port)d',                      # Set to empty string for default. Not used with sqlite3.
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
    }
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
}
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
279
b50206f6238f Add cache form ObjectPermissionChecker objects
verrierj
parents: 265
diff changeset
    55
CACHES = {
b50206f6238f Add cache form ObjectPermissionChecker objects
verrierj
parents: 265
diff changeset
    56
    'default': {
283
0970e0f3d02b Fix bug in project deletion + set up dummy cache
verrierj
parents: 281
diff changeset
    57
        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
279
b50206f6238f Add cache form ObjectPermissionChecker objects
verrierj
parents: 265
diff changeset
    58
    }
b50206f6238f Add cache form ObjectPermissionChecker objects
verrierj
parents: 265
diff changeset
    59
}
b50206f6238f Add cache form ObjectPermissionChecker objects
verrierj
parents: 265
diff changeset
    60
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
DEBUG = True
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
TEMPLATE_DEBUG = DEBUG
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
769
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    64
#LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../log/log.txt"))
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
    65
LOG_FILE = '%(log_file)s'
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
LOG_LEVEL = logging.DEBUG
858
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    67
LOGGING = {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    68
    'version': 1,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    69
    'disable_existing_loggers': False,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    70
    'formatters' : {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    71
        'simple' : {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    72
            'format': "%(asctime)s - %(levelname)s : %(message)s",
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    73
        },
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    74
        'semi-verbose': {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    75
            'format': '%(levelname)s %(asctime)s %(module)s %(message)s'
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    76
        },                    
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    77
    },
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    78
    'handlers': {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    79
        'mail_admins': {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    80
            'level': 'ERROR',
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    81
            'class': 'django.utils.log.AdminEmailHandler'
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    82
        },
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    83
        'stream_to_console': {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    84
            'level': LOG_LEVEL,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    85
            'class': 'logging.StreamHandler'
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    86
        },
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    87
        'file': {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    88
            'level': LOG_LEVEL,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    89
            'class': 'logging.FileHandler',
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    90
            'filename': LOG_FILE,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    91
            'formatter': 'semi-verbose',
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    92
        },
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    93
    },
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    94
    'loggers': {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    95
        'django.db.backends':{
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    96
            'handlers': ['file'],
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    97
            'level': LOG_LEVEL,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    98
            'propagate': True,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
    99
        },                
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   100
        'django.request': {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   101
            'handlers': ['file'],
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   102
            'level': LOG_LEVEL,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   103
            'propagate': True,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   104
        },
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   105
        'ldt': {
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   106
            'handlers': ['file'],
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   107
            'level': LOG_LEVEL,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   108
            'propagate': True,
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   109
        },
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   110
    }
dcf47b385ddd Add logging setup
ymh <ymh.work@gmail.com>
parents: 769
diff changeset
   111
}
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
ADMINS = (
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
    # ('Your Name', 'your_email@domain.com'),
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   116
)
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   117
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
MANAGERS = ADMINS
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   119
769
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
   120
GOOGLE_ANALYTICS_CODE = '%(google_analytics_code)s'
589
e7410c4df032 template cleaning, translation in js, and add generic google analytics
ymh <ymh.work@gmail.com>
parents: 538
diff changeset
   121
769
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
   122
EMAIL_USE_TLS = %(email_use_tls)s
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
   123
EMAIL_HOST = '%(email_host)s'
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
   124
EMAIL_HOST_USER = '%(email_host_user)s'
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
   125
EMAIL_HOST_PASSWORD = '%(email_host_user)s'
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
   126
EMAIL_PORT = %(email_port)d 
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   127
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   128
ACCOUNT_ACTIVATION_DAYS = 7
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   129
REGISTRATION_OPEN = False
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   130
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
LDT_MAX_SEARCH_NUMBER = 50
176
a88714473302 Added a page to display search results
verrierj
parents: 142
diff changeset
   132
LDT_MAX_FRAGMENT_PER_SEARCH = 3
177
32fbed79d3a1 Display search results on multiple pages
verrierj
parents: 176
diff changeset
   133
LDT_RESULTS_PER_PAGE = 1
29
d283ffaa7791 activate gzip + default indent to 0
ymh <ymh.work@gmail.com>
parents: 3
diff changeset
   134
LDT_JSON_DEFAULT_INDENT = 0
644
94429061bbfa First step of pagination for contents and projet in workspace home.
cavaliet
parents: 594
diff changeset
   135
LDT_MAX_CONTENTS_PER_PAGE = 5
94429061bbfa First step of pagination for contents and projet in workspace home.
cavaliet
parents: 594
diff changeset
   136
LDT_MAX_PROJECTS_PER_PAGE = 5
740
d03908cf3c73 front all medias pagination. #26
cavaliet
parents: 722
diff changeset
   137
LDT_FRONT_MEDIA_PER_PAGE = 9
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
EMPTY_MEDIA_EXTERNALID = None
103
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 29
diff changeset
   140
5578dcb54f4d merge context_processors.py and enable upload cancel and remove temp file. Creation of a session temp folder for upload.
cavaliet
parents: 29
diff changeset
   141
AUTO_INDEX_AFTER_SAVE = True
243
3cff86180fbe Replaced calls to objects by calls to safe_objects in views + xml can be changed on the fly to hide a content
verrierj
parents: 196
diff changeset
   142
769
a49769a3088d clean config file and do some correction in the sync script.
ymh <ymh.work@gmail.com>
parents: 740
diff changeset
   143
FORBIDDEN_STREAM_URL = "%(forbidden_stream_url)s"
444
2711eef17092 Update front tag list management with settings/config.
cavaliet
parents: 333
diff changeset
   144
2711eef17092 Update front tag list management with settings/config.
cavaliet
parents: 333
diff changeset
   145
FRONT_TAG_LIST = [u"Enmi 2011", u"film", u"conférence"]
504
32a878a71a80 Users arrive in front pages by default + bugfixes
verrierj
parents: 444
diff changeset
   146
718
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   147
HAYSTACK_CONNECTIONS = {
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   148
    'default': {
719
1c0ac4068bbe improve highlighting management
ymh <ymh.work@gmail.com>
parents: 718
diff changeset
   149
        #for elasticsearch use ldt.indexation.backends.elasticsearch_backend.ElasticsearchSearchEngine
718
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   150
        'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
722
2446fff2bea0 correct search result
cavaliet
parents: 719
diff changeset
   151
        #'URL': 'http://127.0.0.1:9200/',
2446fff2bea0 correct search result
cavaliet
parents: 719
diff changeset
   152
        #'INDEX_NAME': 'ldt',
718
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   153
    },
5e27a39d3742 replace lucene by haystack, remove references to lucene
ymh <ymh.work@gmail.com>
parents: 644
diff changeset
   154
}