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:
@@ -75,6 +75,13 @@ USE_I18N = True
|
|||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
STATIC_URL = 'static/'
|
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'
|
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
MEDIA_ROOT = BASE_DIR / 'media'
|
MEDIA_ROOT = BASE_DIR / 'media'
|
||||||
|
|||||||
11
app/static/README.md
Normal file
11
app/static/README.md
Normal 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`.
|
||||||
Reference in New Issue
Block a user