checks.py 366 B

1234567891011121314
  1. from types import NoneType
  2. from django.conf import settings
  3. from django.core.checks import Error
  4. def check_site_id(app_configs, **kwargs):
  5. if hasattr(settings, "SITE_ID") and not isinstance(
  6. settings.SITE_ID, (NoneType, int)
  7. ):
  8. return [
  9. Error("The SITE_ID setting must be an integer", id="sites.E101"),
  10. ]
  11. return []