Start updating docs.
[wolnelektury.git] / src / wolnelektury / settings / __init__.py
1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
3 #
4 # Django settings for wolnelektury project.
5 import sentry_sdk
6 from sentry_sdk.integrations.django import DjangoIntegration
7
8 from .apps import *
9 from .basic import *
10 from .auth import *
11 from .cache import *
12 from .celery import *
13 from .contrib import *
14 from .custom import *
15 from .locale import *
16 from .static import *
17 from .paths import *
18
19 # Load localsettings, if they exist
20 try:
21     from wolnelektury.localsettings import *
22 except ImportError:
23     pass
24
25
26 # If Celery broker not configured, enable always-eager mode.
27 try:
28     CELERY_BROKER_URL
29 except NameError:
30     CELERY_TASK_ALWAYS_EAGER = True
31
32
33 # If SEARCH_INDEX not configured, disable the search.
34 try:
35     SOLR
36 except NameError:
37     NO_SEARCH_INDEX = True
38 else:
39     NO_SEARCH_INDEX = False
40
41
42 try:
43     SENTRY_DSN
44 except NameError:
45     pass
46 else:
47     sentry_sdk.init(
48         dsn=SENTRY_DSN,
49         integrations=[DjangoIntegration()]
50     )
51
52
53 # Dummy secret key for development.
54 try:
55     SECRET_KEY
56 except NameError:
57     if DEBUG:
58         SECRET_KEY = 'not-a-secret-key'