web/ldtplatform/settings.py
changeset 188 74bad93d3cb7
parent 183 89334901b7c2
child 228 94fdb72b7d56
equal deleted inserted replaced
187:a59dd2aed213 188:74bad93d3cb7
     1 #@PydevCodeAnalysisIgnore
     1 #@PydevCodeAnalysisIgnore
     2 import os.path
     2 import os.path
       
     3 import ldtplatform
     3 # Django settings for project.
     4 # Django settings for project.
     4 
     5 
     5 DEBUG = True
     6 DEBUG = True
     6 TEMPLATE_DEBUG = DEBUG
     7 TEMPLATE_DEBUG = DEBUG
     7 
     8 
    35 
    36 
    36 ugettext = lambda s: s
    37 ugettext = lambda s: s
    37 
    38 
    38 LANGUAGES = ( 
    39 LANGUAGES = ( 
    39     ('fr', ugettext('French')),
    40     ('fr', ugettext('French')),
       
    41     ('en', ugettext('English')),
    40 )
    42 )
    41 
    43 
    42 
    44 
    43 SITE_ID = 1
    45 SITE_ID = 1
    44 
    46 
    80     'django.middleware.common.CommonMiddleware',
    82     'django.middleware.common.CommonMiddleware',
    81     'ldt.ldt_utils.middleware.swfupload.SWFUploadMiddleware',
    83     'ldt.ldt_utils.middleware.swfupload.SWFUploadMiddleware',
    82     'django.contrib.sessions.middleware.SessionMiddleware',
    84     'django.contrib.sessions.middleware.SessionMiddleware',
    83     'django.middleware.csrf.CsrfViewMiddleware',
    85     'django.middleware.csrf.CsrfViewMiddleware',
    84     'django.contrib.auth.middleware.AuthenticationMiddleware',
    86     'django.contrib.auth.middleware.AuthenticationMiddleware',
    85     'django.middleware.locale.LocaleMiddleware',
    87     #'django.middleware.locale.LocaleMiddleware',
    86     'django.contrib.messages.middleware.MessageMiddleware',
    88     'django.contrib.messages.middleware.MessageMiddleware',
    87     'django_openid_consumer.middleware.OpenIDMiddleware',
    89     'django_openid_consumer.middleware.OpenIDMiddleware',
       
    90     'ldt.ldt_utils.middleware.userprofile.LanguageMiddleware',
    88 )
    91 )
    89 
    92 
    90 TEMPLATE_CONTEXT_PROCESSORS = ( 
    93 TEMPLATE_CONTEXT_PROCESSORS = ( 
    91     "django.core.context_processors.request",
    94     "django.core.context_processors.request",
    92     "django.contrib.auth.context_processors.auth",
    95     "django.contrib.auth.context_processors.auth",
    93     "django.core.context_processors.debug",
    96     "django.core.context_processors.debug",
    94     "django.core.context_processors.i18n",
    97     "django.core.context_processors.i18n",
    95     "django.core.context_processors.media",
    98     "django.core.context_processors.media",
    96     "django.core.context_processors.static",
    99     "django.core.context_processors.static",
    97     "ldt.utils.context_processors.ldtcontext",
   100     "ldt.utils.context_processors.ldt_context",
    98 )
   101 )
    99 
       
   100 
   102 
   101 
   103 
   102 ROOT_URLCONF = 'ldtplatform.urls'
   104 ROOT_URLCONF = 'ldtplatform.urls'
   103 
   105 
   104 TEMPLATE_DIRS = (
   106 TEMPLATE_DIRS = (
   105     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
   107     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
   106     # Always use forward slashes, even on Windows.
   108     # Always use forward slashes, even on Windows.
   107     # Don't forget to use absolute paths, not relative paths.
   109     # Don't forget to use absolute paths, not relative paths.
   108     os.path.join(os.path.basename(__file__), 'templates'),
   110     os.path.join(os.path.basename(__file__), 'templates'), 
   109 )
   111     os.path.join(os.path.dirname(__file__), 'templates'),  
   110 
   112 )
       
   113     
   111 FIXTURES_DIRS = (
   114 FIXTURES_DIRS = (
   112     os.path.join(os.path.basename(__file__), 'fixtures'),
   115     os.path.join(os.path.basename(__file__), 'fixtures'),
   113 )
   116 )
   114 
   117 
   115 INSTALLED_APPS = (
   118 INSTALLED_APPS = (
   135     'piston',
   138     'piston',
   136     'social_auth',
   139     'social_auth',
   137     'south',
   140     'south',
   138 )
   141 )
   139 
   142 
       
   143 AUTH_PROFILE_MODULE = 'user.UserProfile'
       
   144 
   140 DECOUPAGE_BLACKLIST = (
   145 DECOUPAGE_BLACKLIST = (
   141      "de_PPP",
   146      "de_PPP",
   142 )
   147 )
   143  
   148  
   144 ZIP_BLACKLIST = (
   149 ZIP_BLACKLIST = (
   181 FACEBOOK_API_SECRET = 'f25e0754a44f0d90d3f4d9ea961ff012'
   186 FACEBOOK_API_SECRET = 'f25e0754a44f0d90d3f4d9ea961ff012'
   182 
   187 
   183 SOCIAL_AUTH_COMPLETE_URL_NAME  = 'complete'
   188 SOCIAL_AUTH_COMPLETE_URL_NAME  = 'complete'
   184 SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete'
   189 SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete'
   185 
   190 
       
   191 # twitter testing
       
   192 TEST_TWITTER_USER = 'jacquesverrier@gmail.com'
       
   193 TEST_TWITTER_PASSWORD = ''
       
   194 
       
   195 # facebook testing
       
   196 #TEST_FACEBOOK_USER = 'testing_account'
       
   197 #TEST_FACEBOOK_PASSWORD = 'password_for_testing_account'
       
   198 
       
   199 # google testing
       
   200 TEST_GOOGLE_USER = 'jacquesverrier@gmail.com'
       
   201 TEST_GOOGLE_PASSWORD = ''
       
   202 
   186 AUTO_INDEX_AFTER_SAVE = True
   203 AUTO_INDEX_AFTER_SAVE = True
       
   204 
       
   205 WEB_VERSION = ldtplatform.get_version()
   187 
   206 
   188 from config import *
   207 from config import *
   189 
   208 
   190 if not "LOGIN_URL" in locals():
   209 if not "LOGIN_URL" in locals():
   191     LOGIN_URL = BASE_URL + 'ldtplatform/accounts/login/'
   210     LOGIN_URL = BASE_URL + 'ldtplatform/accounts/login/'
   203 
   222 
   204 if not "GLOBAL_LOG_LEVEL" in locals():
   223 if not "GLOBAL_LOG_LEVEL" in locals():
   205     GLOBAL_LOG_LEVEL = LOG_LEVEL
   224     GLOBAL_LOG_LEVEL = LOG_LEVEL
   206 if not "GLOBAL_LOG_HANDLERS" in locals():
   225 if not "GLOBAL_LOG_HANDLERS" in locals():
   207     GLOBAL_LOG_HANDLERS = [{'handler':logging.FileHandler(LOG_FILE), 'format':"%(asctime)s - %(levelname)s : %(message)s"}]
   226     GLOBAL_LOG_HANDLERS = [{'handler':logging.FileHandler(LOG_FILE), 'format':"%(asctime)s - %(levelname)s : %(message)s"}]
   208     
       
   209 
   227 
   210 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
   228 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
   211 # trailing slash.
   229 # trailing slash.
   212 # Examples: "http://foo.com/media/", "/media/".
   230 # Examples: "http://foo.com/media/", "/media/".
   213 if not "ADMIN_MEDIA_PREFIX" in locals():
   231 if not "ADMIN_MEDIA_PREFIX" in locals():
   216 if not "LDT_MEDIA_PREFIX" in locals():
   234 if not "LDT_MEDIA_PREFIX" in locals():
   217     LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/'
   235     LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/'
   218 # URL that handles the media served from MEDIA_ROOT.
   236 # URL that handles the media served from MEDIA_ROOT.
   219 if not "MEDIA_URL" in locals():
   237 if not "MEDIA_URL" in locals():
   220     MEDIA_URL = BASE_URL + 'static/media/'
   238     MEDIA_URL = BASE_URL + 'static/media/'
       
   239