Changes between Initial Version and Version 1 of Ticket #30695


Ignore:
Timestamp:
Aug 10, 2019, 11:50:13 AM (5 years ago)
Author:
Tobias McNulty
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30695 – Description

    initial v1  
    11This section of the docs (https://docs.djangoproject.com/en/2.2/topics/files/#storage-objects) suggests that one should use absolute paths when calling storage API methods, but executing this sample code on a fresh Django 2.2 project raises a `SuspiciousFileOperation` error:
    22
    3 ```
     3{{{
    44(filestorage-test) $ pip freeze
    55Django==2.2.4
     
    2929    'component ({})'.format(final_path, base_path))
    3030django.core.exceptions.SuspiciousFileOperation: The joined path (/path/to/file) is located outside of the base path component (/Users/tobias/tmp/filestorage_test)
    31 ```
     31}}}
    3232
    3333I realize one could prepend the path to `MEDIA_ROOT` to work around that, but I'm not sure that's the right convention to establish when relative paths work just as well (not to mention that prepending `MEDIA_ROOT` would be the wrong approach for a remote storage).
Back to Top