Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow webpack_static template tag to reference remote files #110

Closed
saily opened this issue Mar 25, 2017 · 2 comments
Closed

Allow webpack_static template tag to reference remote files #110

saily opened this issue Mar 25, 2017 · 2 comments

Comments

@saily
Copy link

saily commented Mar 25, 2017

Hi,

i was playing around with django-storages and django-minio-storage to upload static files to aws s3 or minio s3 storage.

After a while i noticed this works fine except for my static ressources included with webpack-loader template tags as render_bundle or webpack_static. I digged into the code and round the fallback on STATIC_URL in templatetags/webpack_loader.py which was already refactored on current master, but still has the same issue

@register.simple_tag
def webpack_static(asset_name, config='DEFAULT'):
    return "{0}{1}".format(
        get_loader(config).get_assets().get(
            'publicPath', getattr(settings, 'STATIC_URL')
        ),
        asset_name
    )

When publicPath is set in stats file it's not possible to load it from remote, see #107. It might be a solution in #102 and use default static template tags, but basically this package should work with storage backends as:

  • minio_storage.storage.MinioStaticStorage
  • storages.backends.s3boto3.S3Boto3Storage
  • django.contrib.staticfiles.storage.ManifestStaticFilesStorage
  • whitenoise.storage.CompressedManifestStaticFilesStorage

I'd love to start a discussion here and make this package work with different storage backends and also consider people using whitenoise.

@owais
Copy link
Collaborator

owais commented May 18, 2017

Check my comment here #107 (comment) and #107 (comment)

@owais
Copy link
Collaborator

owais commented May 18, 2017

Closing and moving discussion to #107

@owais owais closed this as completed May 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants