Skip to content

Commit 282c058

Browse files
committed
Fix Docker collectstatic error
- Add STATIC_ROOT setting to Django configuration - Update .dockerignore to allow staticfiles directory - Ensure collectstatic works properly in Docker build - Resolves ImproperlyConfigured error during image build
1 parent 005476f commit 282c058

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: Check imports with isort
4646
run: |
47-
isort --check-only --diff .
47+
isort --check-only --diff --profile black .
4848
4949
- name: Lint with flake8
5050
run: |
@@ -91,4 +91,4 @@ jobs:
9191
DB_PASSWORD: 'test_password'
9292
DB_HOST: 'localhost'
9393
DB_PORT: '5432'
94-
ALLOWED_HOSTS: 'localhost,127.0.0.1'
94+
ALLOWED_HOSTS: 'localhost,127.0.0.1'

config/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
# https://docs.djangoproject.com/en/4.2/howto/static-files/
141141

142142
STATIC_URL = "static/"
143+
STATIC_ROOT = BASE_DIR / "staticfiles"
143144

144145
# Default primary key field type
145146
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field

0 commit comments

Comments
 (0)