jmrivas86 / django-json-widget

An alternative widget that makes it easy to edit the new Django's field JSONField (PostgreSQL specific model fields)
MIT License
440 stars 88 forks source link

Explicitly concatenate `settings.STATIC_URL` with the URL could cause problems when serving static files. #7

Closed aleg closed 4 years ago

aleg commented 6 years ago

Description

I have a custom version of ManifestStaticFilesStorage that removes the non-hashed files when calling collectstatic. The widget concatenates settings.STATIC_URL to the URL pointing to the static files. This means that the hash created by the files storage will be ignored and a 404 will be returned as a result.

This is a specific case, but I think in general it's not a good practice to hardcode/concatenate URLs like that.

What I Did

Happy to create a PR to fix this, it's a very small change.