From c7c790ee09caeaf9fd90c41471d50ec378078a1e Mon Sep 17 00:00:00 2001 From: Stiftung Development Date: Sat, 6 Sep 2025 21:00:22 +0200 Subject: [PATCH] Fix Django static files configuration for CI/CD pipeline - Add STATIC_ROOT setting for collectstatic command - Configure STATICFILES_DIRS for proper static file management - Create app/static directory structure with documentation - Resolve CI ImproperlyConfigured error for staticfiles app - Ensure static files are properly collected during deployment --- app/core/settings.py | 7 +++++++ app/static/README.md | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 app/static/README.md diff --git a/app/core/settings.py b/app/core/settings.py index 38ade65..8a7c45f 100644 --- a/app/core/settings.py +++ b/app/core/settings.py @@ -75,6 +75,13 @@ USE_I18N = True USE_TZ = True STATIC_URL = 'static/' +STATIC_ROOT = BASE_DIR / 'staticfiles' + +# Additional locations of static files +STATICFILES_DIRS = [ + BASE_DIR / "static", +] + DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' MEDIA_URL = '/media/' MEDIA_ROOT = BASE_DIR / 'media' diff --git a/app/static/README.md b/app/static/README.md new file mode 100644 index 0000000..34ac486 --- /dev/null +++ b/app/static/README.md @@ -0,0 +1,11 @@ +# Static Files Directory + +This directory contains static files for the Django application. + +## Structure: +- `css/` - Custom CSS files +- `js/` - Custom JavaScript files +- `img/` - Image assets +- `fonts/` - Font files + +Static files are collected to `staticfiles/` directory during deployment via `python manage.py collectstatic`.