Fundraising in PDF.
[wolnelektury.git] / src / wolnelektury / settings / __init__.py
1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. 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 .celery import *
12 from .contrib import *
13 from .custom import *
14 from .locale import *
15 from .static import *
16 from .paths import *
17
18 # Load localsettings, if they exist
19 try:
20     from wolnelektury.localsettings import *
21 except ImportError:
22     pass
23
24
25 # If Celery broker not configured, enable always-eager mode.
26 try:
27     CELERY_BROKER_URL
28 except NameError:
29     CELERY_TASK_ALWAYS_EAGER = True
30
31
32 try:
33     SENTRY_DSN
34 except NameError:
35     pass
36 else:
37     sentry_sdk.init(
38         dsn=SENTRY_DSN,
39         integrations=[DjangoIntegration()]
40     )
41
42
43 # Dummy secret key for development.
44 try:
45     SECRET_KEY
46 except NameError:
47     if DEBUG:
48         SECRET_KEY = 'not-a-secret-key'