# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
)

TEMPLATE_CONTEXT_PROCESSORS = [
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.request",
    "django.core.context_processors.static",    
    "django.contrib.messages.context_processors.messages",
    "notification.context_processors.notification",
    "social_auth.context_processors.social_auth_backends",
]

TEMPLATE_CONTEXT_PROCESSORS += (
        'txcommon.context_processors.site_section',
        'txcommon.context_processors.bidi',
)

MIDDLEWARE_CLASSES = [
    # Enable GZIP compression
    'django.middleware.gzip.GZipMiddleware',
    'django.middleware.common.CommonMiddleware',
    # Enable protection against Cross Site Request Forgeries
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.doc.XViewMiddleware',
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django_sorting.middleware.SortingMiddleware',
    'pagination.middleware.PaginationMiddleware',
    'userena.middleware.UserenaLocaleMiddleware'
]

AUTHENTICATION_BACKENDS = [
    'userena.backends.UserenaAuthenticationBackend',
    'guardian.backends.ObjectPermissionBackend',
    'social_auth.backends.twitter.TwitterBackend',
    'social_auth.backends.google.GoogleOAuth2Backend',
    'social_auth.backends.facebook.FacebookBackend',
    'social_auth.backends.contrib.linkedin.LinkedinBackend',
    'django.contrib.auth.backends.ModelBackend',
]

ROOT_URLCONF = 'urls'

TEMPLATE_DIRS = [
    os.path.join(TX_ROOT, 'templates'),
]

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder',
)

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.comments',
    'django.contrib.contenttypes',
    'django.contrib.flatpages',
    'django.contrib.humanize',
    'django.contrib.markup',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.sites',
    'django.contrib.admindocs',
    'django.contrib.staticfiles',
    'notification',
    'django_filters',
    'django_sorting',
    'south',
    'tagging',
    'tagging_autocomplete',
    'pagination',
    'piston',
    'contact_form',
    'ajax_select',
    'threadedcomments',
    'authority',
    'haystack',
    'social_auth',
    'userena',
    'guardian',
    'easy_thumbnails',
    # Transifex specific apps:
    'transifex.txcommon',
    'transifex.languages',
    'transifex.projects',
    'transifex.releases',
    'transifex.actionlog',
    'transifex.txpermissions',
    'transifex.teams',
    'transifex.resources',
    'transifex.storage',
    # Must come in the end
    'django_addons',
    'compressor',
]

COMMENTS_APP = 'threadedcomments'
