src/aixweb/settings.py
changeset 10 fb466c64d84c
child 12 dbe15daa39f1
equal deleted inserted replaced
9:2e1053dff5f2 10:fb466c64d84c
       
     1 # -*- coding: utf-8 -*-
       
     2 #@PydevCodeAnalysisIgnore
       
     3 import os.path
       
     4 import ldtplatform
       
     5 # Django settings for project.
       
     6 
       
     7 DEBUG = True
       
     8 TEMPLATE_DEBUG = DEBUG
       
     9 
       
    10 ADMINS = (
       
    11     # ('Your Name', 'your_email@domain.com'),
       
    12 )
       
    13 
       
    14 MANAGERS = ADMINS
       
    15 
       
    16 DATABASES = {
       
    17     'default': {
       
    18         'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
       
    19         'NAME': '',                      # Or path to database file if using sqlite3.
       
    20         'USER': '',                      # Not used with sqlite3.
       
    21         'PASSWORD': '',                  # Not used with sqlite3.
       
    22         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
       
    23         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
       
    24     }
       
    25 }
       
    26 
       
    27 # Local time zone for this installation. Choices can be found here:
       
    28 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
       
    29 # although not all choices may be available on all operating systems.
       
    30 # If running in a Windows environment this must be set to the same as your
       
    31 # system time zone.
       
    32 TIME_ZONE = 'UTC'
       
    33 
       
    34 # Language code for this installation. All choices can be found here:
       
    35 # http://www.i18nguy.com/unicode/language-identifiers.html
       
    36 LANGUAGE_CODE = 'fr-fr'
       
    37 
       
    38 ugettext = lambda s: s
       
    39 
       
    40 LANGUAGES = ( 
       
    41     ('fr', ugettext('French')),
       
    42     ('en', ugettext('English')),
       
    43     ('ja', ugettext('Japanese')),
       
    44 )
       
    45 
       
    46 
       
    47 SITE_ID = 1
       
    48 
       
    49 # If you set this to False, Django will make some optimizations so as not
       
    50 # to load the internationalization machinery.
       
    51 USE_I18N = True
       
    52 
       
    53 # Absolute path to the directory that holds media.
       
    54 # Example: "/home/media/media.lawrence.com/"
       
    55 #MEDIA_ROOT = ''
       
    56 
       
    57 # Root of static files used by each app, generated by code or uploaded by users
       
    58 #STATIC_URL = '/static/'
       
    59 
       
    60 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
       
    61 # trailing slash if there is a path component (optional in other cases).
       
    62 # Examples: "http://media.lawrence.com", "http://example.com/media/"
       
    63 #MEDIA_URL = ''
       
    64 
       
    65 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
       
    66 # trailing slash.
       
    67 # Examples: "http://foo.com/media/", "/media/".
       
    68 
       
    69 #LDT_MEDIA_PREFIX = '/ldt/'
       
    70 
       
    71 # Make this unique, and don't share it with anybody.
       
    72 SECRET_KEY = 't^lii5_z@tho$%6t&b#dm#t9nz$$ylyclxvkdiyqbl+(dnt(ma'
       
    73 
       
    74 # List of callables that know how to import templates from various sources.
       
    75 TEMPLATE_LOADERS = (
       
    76     'django.template.loaders.filesystem.Loader',
       
    77     'django.template.loaders.app_directories.Loader',
       
    78 #     'django.template.loaders.eggs.Loader',
       
    79 )
       
    80 
       
    81 MIDDLEWARE_CLASSES = (
       
    82     'django.middleware.cache.UpdateCacheMiddleware',
       
    83     'django.middleware.common.CommonMiddleware',
       
    84     'django.middleware.cache.FetchFromCacheMiddleware',
       
    85     'django.middleware.gzip.GZipMiddleware',
       
    86     'ldt.ldt_utils.middleware.swfupload.SWFUploadMiddleware',
       
    87     'django.contrib.sessions.middleware.SessionMiddleware',
       
    88     'django.middleware.csrf.CsrfViewMiddleware',
       
    89     'django.contrib.auth.middleware.AuthenticationMiddleware',
       
    90     #'django.middleware.locale.LocaleMiddleware',
       
    91     'django.contrib.messages.middleware.MessageMiddleware',
       
    92     'django_openid_consumer.middleware.OpenIDMiddleware',
       
    93     'ldt.ldt_utils.middleware.userprofile.LanguageMiddleware',
       
    94     'ldt.security.middleware.SecurityMiddleware',
       
    95 )
       
    96 
       
    97 TEMPLATE_CONTEXT_PROCESSORS = ( 
       
    98     "django.core.context_processors.request",
       
    99     "django.contrib.auth.context_processors.auth",
       
   100     "django.core.context_processors.debug",
       
   101     "django.core.context_processors.i18n",
       
   102     "django.core.context_processors.media",
       
   103     "django.core.context_processors.static",
       
   104     "ldt.utils.context_processors.ldt_context",
       
   105 )
       
   106 
       
   107 
       
   108 ROOT_URLCONF = 'ldtplatform.urls'
       
   109 
       
   110 TEMPLATE_DIRS = (
       
   111     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
       
   112     # Always use forward slashes, even on Windows.
       
   113     # Don't forget to use absolute paths, not relative paths.
       
   114     os.path.join(os.path.basename(__file__), 'templates'), 
       
   115     os.path.join(os.path.dirname(__file__), 'templates'),  
       
   116 )
       
   117     
       
   118 FIXTURES_DIRS = (
       
   119     os.path.join(os.path.basename(__file__), 'fixtures'),
       
   120 )
       
   121 
       
   122 INSTALLED_APPS = (
       
   123     'django_extensions',
       
   124     'django.contrib.auth',
       
   125     'django.contrib.contenttypes',
       
   126     'django.contrib.sessions',
       
   127     'django.contrib.sites',
       
   128     'django.contrib.messages',
       
   129     'django.contrib.admin',
       
   130     'django.contrib.staticfiles',
       
   131     'haystack',
       
   132     'tastypie',
       
   133     'guardian',
       
   134     'tagging',
       
   135     'registration',
       
   136     'oauth_provider',
       
   137     'django_openid_consumer',
       
   138     'social_auth',
       
   139     'south',
       
   140     'sorl.thumbnail',
       
   141     'ldt',
       
   142     'ldt.core',
       
   143     'ldt.security',
       
   144     'ldt.user',
       
   145     'ldt.ldt_utils',
       
   146     'ldt.text',
       
   147     'ldt.management',
       
   148     'ldt.indexation',
       
   149     'hashcut',
       
   150     'chunked_uploads',
       
   151     'ldtplatform',
       
   152 )
       
   153 
       
   154 #AUTH_PROFILE_MODULE = 'user.UserProfile'
       
   155 AUTH_USER_MODEL = 'user.LdtUser'
       
   156 INITIAL_CUSTOM_USER_MIGRATION = "0009_rename_auth_user_to_user_ldt_user"
       
   157 
       
   158 DECOUPAGE_BLACKLIST = (
       
   159      "de_PPP",
       
   160 )
       
   161  
       
   162 ZIP_BLACKLIST = (
       
   163      "__MACOSX",
       
   164 )
       
   165 
       
   166 AUTHENTICATION_BACKENDS = (
       
   167     'social_auth.backends.twitter.TwitterBackend',
       
   168     'social_auth.backends.facebook.FacebookBackend',
       
   169 #    'social_auth.backends.google.GoogleOAuthBackend',
       
   170 #    'social_auth.backends.google.GoogleOAuth2Backend',
       
   171     'social_auth.backends.google.GoogleBackend',
       
   172     'social_auth.backends.yahoo.YahooBackend',
       
   173 #    'social_auth.backends.contrib.linkedin.LinkedinBackend',
       
   174 #    'social_auth.backends.contrib.LiveJournalBackend',
       
   175 #    'social_auth.backends.contrib.orkut.OrkutBackend',
       
   176     'social_auth.backends.OpenIDBackend',
       
   177     'django.contrib.auth.backends.ModelBackend',
       
   178     'guardian.backends.ObjectPermissionBackend',
       
   179 )
       
   180 #SOCIAL_AUTH_IMPORT_BACKENDS = (
       
   181 #    'myproy.social_auth_extra_services',
       
   182 #)
       
   183 
       
   184 ACCOUNT_ACTIVATION_DAYS = 7 
       
   185 
       
   186 LDT_MAX_SEARCH_NUMBER = 50
       
   187 LDT_JSON_DEFAULT_INDENT = 0
       
   188 LDT_MAX_FRAGMENT_PER_SEARCH = 3
       
   189 LDT_RESULTS_PER_PAGE = 10
       
   190 LDT_MAX_CONTENTS_PER_PAGE = 10
       
   191 LDT_MAX_PROJECTS_PER_PAGE = 10
       
   192 LDT_FRONT_MEDIA_PER_PAGE = 9
       
   193 LDT_FRONT_PROJECTS_PER_PAGE = 12
       
   194 
       
   195 OAUTH_PROVIDER_KEY_SIZE = 32
       
   196 OAUTH_PROVIDER_SECRET_SIZE = 32
       
   197 OAUTH_PROVIDER_VERIFIER_SIZE = 10
       
   198 OAUTH_PROVIDER_CONSUMER_KEY_SIZE = 256
       
   199 OAUTH_AUTHORIZE_VIEW = 'oauth_provider.views.fake_authorize_view'
       
   200 OAUTH_CALLBACK_VIEW = 'oauth_provider.views.fake_callback_view'
       
   201 TEST_WEBSERVER_ADDRPORT = "127.0.0.1:8888"
       
   202 
       
   203 TWITTER_CONSUMER_KEY     = 'UxAdbOLSo4Mx3CXIwDG9Eg'
       
   204 TWITTER_CONSUMER_SECRET  = '2PcWgdjnJL6Vp8srB40jeAo0fjMEtDnUwmAia6EUww'
       
   205 FACEBOOK_APP_ID = '163134140411313'
       
   206 FACEBOOK_API_SECRET = 'f25e0754a44f0d90d3f4d9ea961ff012'
       
   207 
       
   208 SOCIAL_AUTH_COMPLETE_URL_NAME  = 'complete'
       
   209 SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete'
       
   210 
       
   211 
       
   212 AUTO_INDEX_AFTER_SAVE = True
       
   213 
       
   214 ANONYMOUS_USER_ID = -1
       
   215 
       
   216 WEB_VERSION = ldtplatform.get_version()
       
   217 
       
   218 DIVISIONS_FOR_STAT_ANNOTATION = 64
       
   219 
       
   220 FRONT_TAG_LIST = []
       
   221 
       
   222 DEFAULT_CONTENT_ICON = "thumbnails/contents/content_default_icon.png"
       
   223 DEFAULT_PROJECT_ICON = "thumbnails/projects/project_default_icon.png"
       
   224 DEFAULT_USER_ICON = "thumbnails/users/user_default_icon.png"
       
   225 DEFAULT_GROUP_ICON = "thumbnails/groups/group_default_icon.png"
       
   226 PROFILE_IMG_MAX_SIZE = 1000000
       
   227 
       
   228 USE_GROUP_PERMISSIONS = ['Project', 'Content', 'Media']
       
   229 FORBIDDEN_STREAM_URL = "rtmp://media.iri.centrepompidou.fr/ddc_player/mp4:video/forbidden_stream.mp4?old_path="
       
   230 PUBLIC_GROUP_NAME = 'everyone'
       
   231 MAX_USERS_SEARCH = 20
       
   232 
       
   233 SYNTAX = {
       
   234           '++' : 'OK',
       
   235           '--' : 'KO',
       
   236           '==' : 'REF',
       
   237           '??' : 'Q'
       
   238           }
       
   239 
       
   240 EXTERNAL_STREAM_SRC = ['youtube.com', 'dailymotion.com', 'vimeo.com']
       
   241 
       
   242 HAYSTACK_CONNECTIONS = {
       
   243     'default': {
       
   244         'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
       
   245     },
       
   246 }
       
   247 HAYSTACK_SIGNAL_PROCESSOR = 'ldt.indexation.signals.LdtSignalProcessor'
       
   248 
       
   249 from config import *
       
   250 
       
   251 if not "SRC_BASE_URL" in locals():
       
   252     SRC_BASE_URL = BASE_URL + __name__.split('.')[0] + '/' 
       
   253 
       
   254 if not "SRC_BASE_URL" in locals():
       
   255     SRC_BASE_URL = BASE_URL + 'ldtplatform/' 
       
   256 
       
   257 if not "LOGIN_URL" in locals():
       
   258     LOGIN_URL = SRC_BASE_URL + 'accounts/login/'
       
   259 if not "LOGOUT_URL" in locals():
       
   260     LOGOUT_URL = SRC_BASE_URL + 'accounts/disconnect/'
       
   261 if not "LOGIN_REDIRECT_URL" in locals():
       
   262     LOGIN_REDIRECT_URL = SRC_BASE_URL + 'ldt/'
       
   263 if not "LOGOUT_REDIRECT_URL" in locals():
       
   264     LOGOUT_REDIRECT_URL = SRC_BASE_URL + 'accounts/login'
       
   265 if not "PROFILE_REDIRECT_URL" in locals():
       
   266     PROFILE_REDIRECT_URL = SRC_BASE_URL + 'auth_accounts/create/profile'
       
   267 
       
   268 if not "LOGIN_ERROR_URL" in locals():
       
   269     LOGIN_ERROR_URL = SRC_BASE_URL + 'accounts/login'
       
   270 
       
   271 # Used in a lot of templates
       
   272 if not "LDT_MEDIA_PREFIX" in locals():
       
   273     LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/'
       
   274 # URL that handles the media served from MEDIA_ROOT.
       
   275 if not "MEDIA_URL" in locals():
       
   276     MEDIA_URL = BASE_URL + 'static/media/'
       
   277 
       
   278 #forced settings    
       
   279 MAX_TAG_LENGTH = 255
       
   280 FORCE_LOWERCASE_TAGS = True
       
   281 
       
   282     
       
   283