Skip to content

Commit

Permalink
feat(settings): configure static file storage/serving
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Jan 27, 2025
1 parent 8a4d5d6 commit e577361
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
!web/oauth/migrations/sample_fixtures.json
dist/
static/
!web/static
__pycache__/
.coverage
.DS_Store
Expand Down
16 changes: 13 additions & 3 deletions web/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,19 @@ def RUNTIME_ENVIRONMENT():

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.1/howto/static-files/

STATIC_URL = "static/"

STATIC_URL = "/static/"
STATICFILES_DIRS = [os.path.join(BASE_DIR, "web", "static")]
# use Manifest Static Files Storage by default
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
},
"staticfiles": {
"BACKEND": os.environ.get(
"DJANGO_STATICFILES_STORAGE", "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
)
},
}
STATIC_ROOT = os.path.join(BASE_DIR, "static")

# Default primary key field type
Expand Down

0 comments on commit e577361

Please sign in to comment.