Skip to content

Commit

Permalink
Feat: static files config (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman authored Jan 27, 2025
2 parents 8a4d5d6 + 61ca727 commit 1ea132f
Show file tree
Hide file tree
Showing 4 changed files with 15 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
1 change: 1 addition & 0 deletions web/core/templates/core/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
href="https://cdn.cdt.ca.gov/cdt/statetemplate/6.4.1/css/colortheme-oceanside.css"
integrity="sha256-PC5Yszm8bAjYYFmjeL8EeB8mHo+S4dJbQt4OwA4aTmg="
crossorigin="anonymous" />
<link rel="stylesheet" href="{% static "css/styles.css" %}">
<!-- State Template JavaScript CDN -->
<script src="https://cdn.cdt.ca.gov/cdt/statetemplate/6.4.1/js/cagov.core.js"
integrity="sha256-TOklMoh1iWoUNIVyzn+Wq8bS56lQWa0R8qklisvEALo="
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
Empty file added web/static/css/styles.css
Empty file.

0 comments on commit 1ea132f

Please sign in to comment.