checks.py 475 B

1234567891011121314
  1. from django.core.checks import Error
  2. from django.core.files.storage import FileSystemStorage, default_storage
  3. def storage_check(app_configs, **kwargs):
  4. if isinstance(default_storage, FileSystemStorage):
  5. return [
  6. Error(
  7. "FileSystemStorage should not be used in a production environment.",
  8. hint="Please verify your DEFAULT_FILE_STORAGE setting.",
  9. id="s3file.E001",
  10. )
  11. ]
  12. return []