-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapps.py
More file actions
31 lines (24 loc) · 974 Bytes
/
apps.py
File metadata and controls
31 lines (24 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from django.apps import AppConfig
from django.core import checks
def check_site_base_url_config(app_configs, **kwargs): # type: ignore[no-untyped-def]
errors = []
from django.conf import settings
if (
not hasattr(settings, "DJANGO_EMAIL_LEARNING")
or "SITE_BASE_URL" not in settings.DJANGO_EMAIL_LEARNING
):
errors.append(
checks.Error(
"DJANGO_EMAIL_LEARNING['SITE_BASE_URL'] is not set in settings.",
hint="Please set DJANGO_EMAIL_LEARNING['SITE_BASE_URL'] to the base URL of your site.",
id="django_email_learning.E001",
)
)
return errors
class EmailLearningConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "django_email_learning"
verbose_name = "Email Learning"
def ready(self) -> None:
import django_email_learning.signals # noqa
checks.register(check_site_base_url_config)