Skip to content

Commit aa7851e

Browse files
committed
Revert back azure blob dependencies
- Add STATIC_ROOT for local static files
1 parent 09220dc commit aa7851e

File tree

3 files changed

+270
-176
lines changed

3 files changed

+270
-176
lines changed

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)