-# -*- coding: utf-8 -*-
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
# Django settings for wolnelektury project.
+import sentry_sdk
+from sentry_sdk.integrations.django import DjangoIntegration
+
+from .apps import *
from .basic import *
from .auth import *
from .cache import *
from .static import *
from .paths import *
-
-MIDDLEWARE_CLASSES = [
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'ssify.middleware.SsiMiddleware',
- 'django.middleware.cache.UpdateCacheMiddleware',
- 'ssify.middleware.PrepareForCacheMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.admindocs.middleware.XViewMiddleware',
- 'fnp_django_pagination.middleware.PaginationMiddleware',
- 'ssify.middleware.LocaleMiddleware',
- 'maintenancemode.middleware.MaintenanceModeMiddleware',
- 'django.middleware.common.CommonMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'fnpdjango.middleware.SetRemoteAddrFromXRealIP',
- 'django.middleware.cache.FetchFromCacheMiddleware',
-]
-
-ROOT_URLCONF = 'wolnelektury.urls'
-
-# These are the ones we should test.
-INSTALLED_APPS_OUR = [
- 'wolnelektury',
- # our
- 'ajaxable',
- 'api',
- 'catalogue',
- 'chunks',
- 'dictionary',
- 'infopages',
- 'lesmianator',
- 'newtagging',
- 'opds',
- 'pdcounter',
- 'reporting',
- 'sponsors',
- 'stats',
- 'suggest',
- 'picture',
- 'social',
- 'waiter',
- 'search',
- 'oai',
- 'funding',
- 'polls',
- 'libraries',
- 'newsletter',
- 'contact',
- 'isbn',
- 'paypal',
-]
-
-GETPAID_BACKENDS = (
- 'getpaid.backends.payu',
-)
-
-INSTALLED_APPS_CONTRIB = [
- # Should be before django.contrib.admin
- 'modeltranslation',
-
- # external
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.sites',
- 'django.contrib.admin',
- 'django.contrib.admindocs',
- 'django.contrib.staticfiles',
- 'fnp_django_pagination',
- 'pipeline',
- 'piston',
- 'piwik',
- 'sorl.thumbnail',
- 'kombu.transport.django',
- 'honeypot',
- 'fnpdjango',
- 'getpaid',
- 'getpaid.backends.payu',
- 'ssify',
- 'django_extensions',
- 'raven.contrib.django.raven_compat',
-
- 'migdal',
- 'django_comments',
- 'django_comments_xtd',
-
- # allauth stuff
- 'uni_form',
- 'allauth',
- 'allauth.account',
- 'allauth.socialaccount',
- 'allauth.socialaccount.providers.openid',
- 'allauth.socialaccount.providers.facebook',
- 'allauth.socialaccount.providers.google',
- # 'allauth.socialaccount.providers.twitter',
- ]
-
-INSTALLED_APPS = INSTALLED_APPS_OUR + INSTALLED_APPS_CONTRIB
-
# Load localsettings, if they exist
try:
from wolnelektury.localsettings import *
except ImportError:
pass
+
+
+try:
+ SENTRY_DSN
+except NameError:
+ pass
+else:
+ sentry_sdk.init(
+ dsn=SENTRY_DSN,
+ integrations=[DjangoIntegration()]
+ )