This repository was archived by the owner on Dec 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
{{cookiecutter.project_slug}}
{{cookiecutter.project_slug}} Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ python manage.py collectstatic --no-input
34python manage.py migrate --noinput
45
56waitress-serve --port=$PORT {{cookiecutter.project_slug}}.wsgi:application
Original file line number Diff line number Diff line change @@ -303,4 +303,14 @@ def google_service_account_config():
303303 STATICFILES_STORAGE = "storages.backends.gcloud.GoogleCloudStorage"
304304 GS_DEFAULT_ACL = "publicRead"
305305
306+ # Configuration for Azure Storage
307+ AS_BUCKET_NAME = env .str ("AS_BUCKET_NAME" , "" )
308+ if AS_BUCKET_NAME :
309+ AZURE_ACCOUNT_NAME = AS_BUCKET_NAME
310+ AZURE_TOKEN_CREDENTIAL = DefaultAzureCredential ()
311+ AS_STATIC_CONTAINER = env .str ("AS_STATIC_CONTAINER" , "static" )
312+ AS_MEDIA_CONTAINER = env .str ("AS_MEDIA_CONTAINER" , "media" )
313+ DEFAULT_FILE_STORAGE = "{{cookiecutter.project_slug}}.storage_backends.AzureMediaStorage"
314+ STATICFILES_STORAGE = "{{cookiecutter.project_slug}}.storage_backends.AzureStaticStorage"
315+
306316DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
Original file line number Diff line number Diff line change 1+ from django .conf import settings
2+ from storages .backends .azure_storage import AzureStorage
3+
4+ class AzureStaticStorage (AzureStorage ):
5+ azure_container = settings .AS_STATIC_CONTAINER
6+ expiration_secs = None
7+
8+ class AzureMediaStorage (AzureStorage ):
9+ azure_container = settings .AS_MEDIA_CONTAINER
10+ expiration_secs = 3600
You can’t perform that action at this time.
0 commit comments