explorerhq / explorerhq/sql-explorer

Static files URL missing "/" on Azure storage

Open
#694 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
2.9k
Forks
373
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.