Skip to content

Commit c773a8a

Browse files
Merge pull request #2421 from IFRCGo/fix/azure-storage-issue
Revert back azure blob dependencies
2 parents 09220dc + dc6b805 commit c773a8a

File tree

4 files changed

+271
-177
lines changed

4 files changed

+271
-177
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ WORKDIR $HOME
2222
COPY pyproject.toml poetry.lock $HOME/
2323

2424
# Upgrade pip and install python packages for code
25-
RUN pip install --upgrade --no-cache-dir pip poetry \
25+
RUN pip install --upgrade --no-cache-dir pip "poetry>=2.1,<2.2" \
2626
&& poetry --version \
2727
# Configure to use system instead of virtualenvs
2828
&& poetry config virtualenvs.create false \

main/settings.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
import environ
99
import pytz
10-
from azure.identity import DefaultAzureCredential
10+
11+
# from azure.identity import DefaultAzureCredential
1112
from corsheaders.defaults import default_headers
1213
from django.utils.translation import gettext_lazy as _
1314
from urllib3.util.retry import Retry
@@ -470,6 +471,7 @@ def parse_domain(*env_keys: str) -> str:
470471

471472
if env("AZURE_STORAGE_ENABLED"):
472473

474+
STATIC_ROOT = env("DJANGO_STATIC_ROOT")
473475
AZURE_STORAGE_CONFIG_OPTIONS = {
474476
"connection_string": env("AZURE_STORAGE_CONNECTION_STRING"),
475477
"overwrite_files": False,
@@ -484,8 +486,8 @@ def parse_domain(*env_keys: str) -> str:
484486
}
485487
)
486488

487-
if env("AZURE_STORAGE_MANAGED_IDENTITY"):
488-
AZURE_STORAGE_CONFIG_OPTIONS["token_credential"] = DefaultAzureCredential()
489+
# if env("AZURE_STORAGE_MANAGED_IDENTITY"):
490+
# AZURE_STORAGE_CONFIG_OPTIONS["token_credential"] = DefaultAzureCredential()
489491

490492
STORAGES = {
491493
"default": {
@@ -495,15 +497,16 @@ def parse_domain(*env_keys: str) -> str:
495497
"azure_container": "api",
496498
},
497499
},
498-
# FIXME: Use this instead of nginx for staticfiles
499-
# "staticfiles": {
500-
# "BACKEND": "storages.backends.azure_storage.AzureStorage",
501-
# "OPTIONS": {
502-
# **AZURE_STORAGE_CONFIG_OPTIONS,
503-
# "azure_container": env("AZURE_STORAGE_STATIC_CONTAINER"),
504-
# "overwrite_files": True,
505-
# },
506-
# },
500+
"staticfiles": {
501+
"BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
502+
# FIXME: Use this instead of nginx for staticfiles
503+
# "BACKEND": "storages.backends.azure_storage.AzureStorage",
504+
# "OPTIONS": {
505+
# **AZURE_STORAGE_CONFIG_OPTIONS,
506+
# "azure_container": env("AZURE_STORAGE_STATIC_CONTAINER"),
507+
# "overwrite_files": True,
508+
# },
509+
},
507510
}
508511

509512
# NOTE: This is used for instances outside azure environment

0 commit comments

Comments
 (0)