checks.py 350 B

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