diff options
Diffstat (limited to 'settings.py')
-rwxr-xr-x[-rw-r--r--] | settings.py | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/settings.py b/settings.py index 45685788..96c20cc3 100644..100755 --- a/settings.py +++ b/settings.py @@ -13,19 +13,22 @@ TEMPLATE_LOADERS = ( # 'django.template.loaders.eggs.load_template_source', ) -MIDDLEWARE_CLASSES = ( - 'django.middleware.gzip.GZipMiddleware', +MIDDLEWARE_CLASSES = [ + #'django.middleware.gzip.GZipMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', #'django.middleware.locale.LocaleMiddleware', + #'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.common.CommonMiddleware', + #'django.middleware.cache.FetchFromCacheMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.middleware.transaction.TransactionMiddleware', #'django.middleware.sqlprint.SqlPrintingMiddleware', 'middleware.anon_user.ConnectToSessionMessagesMiddleware', 'middleware.pagesize.QuestionsPageSizeMiddleware', 'middleware.cancel.CancelActionMiddleware', - #'debug_toolbar.middleware.DebugToolbarMiddleware', -) + 'debug_toolbar.middleware.DebugToolbarMiddleware', + 'recaptcha_django.middleware.ReCaptchaMiddleware', + 'django.middleware.transaction.TransactionMiddleware', +] TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.request', @@ -51,7 +54,10 @@ ALLOW_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff') # unit byte ALLOW_MAX_FILE_SIZE = 1024 * 1024 -INSTALLED_APPS = ( +# User settings +from settings_local import * + +INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -61,10 +67,33 @@ INSTALLED_APPS = ( 'django.contrib.sitemaps', 'forum', 'django_authopenid', - 'djangosphinx', - #'debug_toolbar' , + 'debug_toolbar' , 'user_messages', -) +] -# User settings -from settings_local import * +AUTHENTICATION_BACKENDS = ['django.contrib.auth.backends.ModelBackend',] + +if USE_SPHINX_SEARCH: + INSTALLED_APPS.append('djangosphinx') + +if USE_FB_CONNECT: + INSTALLED_APPS.append('fbconnect') + +if DATABASE_ENGINE in ('postgresql_psycopg2', 'postgresql', ): + USE_PG_FTS = True + INSTALLED_APPS.append('pgfulltext') +else: + USE_PG_FTS = False + +#load optional plugin module for external password login +if 'USE_EXTERNAL_LEGACY_LOGIN' in locals() and USE_EXTERNAL_LEGACY_LOGIN: + INSTALLED_APPS.append(EXTERNAL_LEGACY_LOGIN_MODULE) + + if 'EXTERNAL_LEGACY_LOGIN_AUTHENTICATION_BACKEND' in locals(): + AUTHENTICATION_BACKENDS.append(EXTERNAL_LEGACY_LOGIN_AUTHENTICATION_BACKEND) + if 'EXTERNAL_LEGACY_LOGIN_AUTHENTICATION_MIDDLEWARE' in locals(): + MIDDLEWARE_CLASSES.append(EXTERNAL_LEGACY_LOGIN_AUTHENTICATION_MIDDLEWARE) + def LOAD_EXTERNAL_LOGIN_APP(): + return __import__(EXTERNAL_LEGACY_LOGIN_MODULE, [], [], ['api','forms','views']) +else: + LOAD_EXTERNAL_LOGIN_APP = lambda: None |