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
This commit is contained in:
Stiftung Development
2025-09-06 21:00:22 +02:00
parent 54bf468c53
commit c7c790ee09
2 changed files with 18 additions and 0 deletions

View File

@@ -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'

11
app/static/README.md Normal file
View File

@@ -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`.