Closed fritzfs closed 2 months ago
PS, I am aware of this PR and if I understood it correctly, it should work as I described above? https://github.com/jschneier/django-storages/pull/1176
Found solution! If we're using AZURE_CUSTOM_DOMAIN, we cannot use AZURE_CONNECTION_STRING because _get_service_client method is not fully executed, see this return: https://github.com/jschneier/django-storages/blob/master/storages/backends/azure_storage.py#L160
So, instead of using a connection string for auth (https://django-storages.readthedocs.io/en/latest/backends/azure.html#authentication-settings), we used this:
export AZURE_ACCOUNT_NAME=...
export AZURE_ACCOUNT_KEY=...
export AZURE_CUSTOM_DOMAIN=blabla.com
export AZURE_CONTAINER=...
Hi!
When I call url property on file, I get the full URL as if I did not set AZURE_CUSTOM_DOMAIN, for example:
https://something.blob.core.windows.net/mediafiles/cache/54/07/54077efe688aecfb1ef32ab868b85717.jpg
I want django-storages to work all operations without a custom domain, but I want this URL with a custom domain that represents my CDN (azure front door).
While debugging azure_storage.py inside django-storages, I see that custom_domain is loaded inside the class and custom_service_client exists, but url method still returns original azure blob url here:
https://github.com/jschneier/django-storages/blob/master/storages/backends/azure_storage.py#L332
I'm using
I have the following code in settings.py: