storage.py 481 B

1234567891011121314
  1. from django.conf import settings
  2. from django.core.files.storage import FileSystemStorage
  3. from django.utils.functional import cached_property
  4. class ScriptFileSystemStorage(FileSystemStorage):
  5. """
  6. Custom storage for scripts - for django-storages as the default one will
  7. go off media-root and raise security errors as the scripts can be outside
  8. the media-root directory.
  9. """
  10. @cached_property
  11. def base_location(self):
  12. return settings.SCRIPTS_ROOT