Skip to content

Commit

Permalink
fix infra configruation
Browse files Browse the repository at this point in the history
  • Loading branch information
ddunne6 committed May 12, 2023
1 parent 75fbfef commit b9a76bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
1 change: 0 additions & 1 deletion django_euro_vote/custom_azure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from storages.backends.azure_storage import AzureStorage
from .settings import AZURE_BLOB_KEY, AZURE_ACCOUNT_NAME

Expand Down
14 changes: 4 additions & 10 deletions django_euro_vote/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@
WSGI_APPLICATION = 'django_euro_vote.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases

if DEVELOPMENT_MODE:
DATABASES = {
Expand All @@ -111,9 +109,6 @@
}


# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
Expand Down Expand Up @@ -155,9 +150,6 @@
MEDIA_ROOT = f"{BASE_DIR}/media/"
MEDIA_URL = '/media/'
else:
DEFAULT_FILE_STORAGE = 'django_euro_vote.custom_azure.AzureMediaStorage'
STATICFILES_STORAGE = 'django_euro_vote.custom_azure.AzureStaticStorage'

STATIC_LOCATION = "static"
MEDIA_LOCATION = "media"

Expand All @@ -167,7 +159,9 @@
MEDIA_URL = f'https://{AZURE_CUSTOM_DOMAIN}/{MEDIA_LOCATION}/'
AZURE_BLOB_KEY = env('AZ_BLOB_KEY')

# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
STORAGES = {
"default": {"BACKEND": "django_euro_vote.custom_azure.AzureMediaStorage"},
"staticfiles": {"BACKEND": "django_euro_vote.custom_azure.AzureStaticStorage"},
}

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ django-environ==0.10.0
django_countries==7.5.1
django-crispy-forms==2.0
django-import-export==3.2.0
crispy-bootstrap5==0.7
crispy-bootstrap5==0.7
django-storages[azure]
mysqlclient==2.1.1

0 comments on commit b9a76bc

Please sign in to comment.