Skip to content

Custom private storages with nginx #75

Description

@BlueberryCat0

Using custom PrivateFileSystemStorage with a complex kwarg location arises “problem” doesn’t read nested subfolders within the folder containing private files.

# Storage
DOCUMENT_SECOND_STORAGE: ty.Final[PrivateFileSystemStorage] = PrivateFileSystemStorage(
    location=f'{settings.PRIVATE_STORAGE_ROOT}/docs_second',
    base_url='/storage/docs_second/',
)

# View url
urlpatterns = (
    re_path('^docs-second/(?P<path>.*)', DocumentSecondStorageView.as_view()),
)

As for url http://localhost/storage/docs-second/1_TPgao9l4.jpeg within the folder however won’t go into subfolders to look for the file.

How do I get it fixed correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions