Aleksi44 / wagtailsvg

Wagtail + SVG
https://pypi.org/project/wagtailsvg/
GNU General Public License v3.0
35 stars 24 forks source link

Support for other storages? #6

Closed perepicornell closed 2 years ago

perepicornell commented 3 years ago

Hi! Thanks a lot for the package, it's great.

When I tried it it was not working, and then I realized that it was storing the files at a local /svg folder instead of the storage that I have by default, which is s3boto for an s3-like provider I use.

I see your code defining this:

    storage = FileSystemStorage(
        location=settings.MEDIA_ROOT,
        base_url=settings.MEDIA_URL
    )

But to be honest I don't understand django storages well enough as for imagining the next steps to make it compatible.

So I'm sharing it here in case you or someone else can shed some light about how to approach it. Sorry I can't be more useful right now!

Aleksi44 commented 3 years ago

Hi @perepicornell

Can you test your project with this version:

pip install wagtailsvg==0.0.11

I use django storage myself with this version and like this in my settings :

STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'

It's possible that the latest version 0.0.13 is broken some things with django-storage.

perepicornell commented 3 years ago

Hi! Just tried it, and now it works like a charm!

Aleksi44 commented 3 years ago

@perepicornell Nice :)

@VanL Do you have any idea why 0.0.13 doesn't work with django-storage?

zerolab commented 3 years ago

I suspect the issue stems from the fact that https://github.com/Aleksi44/wagtailsvg/pull/5/files sets the storage explicitly as FileSystemStorage

I see 0.0.14 fixes the issue by reverting that change.