mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-22 16:31:09 -05:00
22 lines
722 B
Python
22 lines
722 B
Python
# Django system check to ensure daphne app is listed in INSTALLED_APPS before django.contrib.staticfiles.
|
|
from django.core.checks import Error, register
|
|
|
|
|
|
@register()
|
|
def check_daphne_installed(app_configs, **kwargs):
|
|
from django.apps import apps
|
|
from django.contrib.staticfiles.apps import StaticFilesConfig
|
|
|
|
from daphne.apps import DaphneConfig
|
|
|
|
for app in apps.get_app_configs():
|
|
if isinstance(app, DaphneConfig):
|
|
return []
|
|
if isinstance(app, StaticFilesConfig):
|
|
return [
|
|
Error(
|
|
"Daphne must be listed before django.contrib.staticfiles in INSTALLED_APPS.",
|
|
id="daphne.E001",
|
|
)
|
|
]
|