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

Static files URL missing "/" on Azure storage #694

Open
adam-hrb opened this issue Jan 9, 2025 · 0 comments
Open

Static files URL missing "/" on Azure storage #694

adam-hrb opened this issue Jan 9, 2025 · 0 comments

Comments

@adam-hrb
Copy link

adam-hrb commented Jan 9, 2025

I just upgraded sql-explorer from 4.2 to 5.3 and I see that the pages like explorer/play/ have broken links to static files (styling, images, js, etc) resulting on completely broken styling.

A combination of Django + Azure Storage + SQL Explorer generates links like
https://myblobname.blob.core.windows.net/static/explorermain.5.3.js instead of https://myblobname.blob.core.windows.net/static/explorer/main.5.3.js

It works properly for me on local file storage, but when I switch to my final Azure environment it's missing the trailing / after 'explorer/'.

I investigated that a bit and in file 'vite.py' on Azure
VITE_OUTPUT_DIR = staticfiles_storage.url("explorer/")
returns https://myblobname.blob.core.windows.net/static/explorer so all the latter concatenations are wrong.

It might be a bug in django-storages but I did not find any bug reports related to that, so maybe it's your code being too optimistic.

The simple workaround could be just to check if the VITE_OUTPUT_DIR provided by storage has the trailing / and if not - appending it back.

@adam-hrb adam-hrb changed the title Static files URL missing / on Azure storage Static files URL missing "/" on Azure storage Jan 10, 2025
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

1 participant