-
Notifications
You must be signed in to change notification settings - Fork 0
/
checks.py
47 lines (32 loc) · 1.07 KB
/
checks.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from django.conf import settings
from django.core.checks import Error, Tags, register
from singleton import __title__ as APP_TITLE
APP_DEPENDENCIES = [
# list of django-apps required by this app
]
APP_SETTINGS = {
# map of config settings required by this app
}
THIRD_PARTY_SETTINGS = {
# map of config settings required by dependencies of this app
}
@register(Tags.compatibility)
def check_app_dependencies(app_configs, **kwargs):
errors = []
for i, dependency in enumerate(APP_DEPENDENCIES):
if dependency not in settings.INSTALLED_APPS:
errors.append(
Error(
f"You are using {APP_TITLE} which requires the {dependency} module. Please install it and add it to INSTALLED_APPS.",
id=f"{APP_TITLE}:E{i:03}",
)
)
return errors
@register(Tags.compatibility)
def check_app_settings(app_configs, **kwargs):
errors = []
return errors
@register(Tags.compatibility)
def check_third_party_settings(app_configs, **kwargs):
errors = []
return errors