Skip to content

Custom Staticfiles App Hides Source Assets #980

@wesleyboar

Description

@wesleyboar

Note

Generated by AI. Edited by @wesleyboar.

Summary

A custom staticfiles AppConfig (TaccStaticFilesConfig) and global ignore patterns cause source assets (for example, files under */src/*.css) to be excluded from Django's staticfiles processing. This breaks local debugging, collectstatic expectations, and can silently hide files.

Files / Locations

  • taccsite_cms/django/contrib/staticfiles_custom/apps.py (custom AppConfig and ignore patterns)
  • taccsite_cms/settings.py (STATICFILES settings reference / usage)

Problems / Impact

  • collectstatic and dev servers may not expose source files; developers cannot debug or reference source CSS/JS.
  • Unexpected missing files in different environments (dev vs prod).
  • Makes contributor onboarding harder because the source/build split is enforced silently.

Proposed (Backward-Compatible) Approach

  1. Prefer the standard django.contrib.staticfiles AppConfig by default.
  2. If custom ignore patterns are desired, make them configurable via a setting (e.g., TACCSITE_STATICFILES_IGNORE_PATTERNS = [...]). If the setting is absent, do not apply any ignore rules.
  3. Add startup warning when ignore patterns are enabled, and document how to include src during development.
  4. Consider a small management command manage.py staticfiles-check to show which files would be collected given current ignore rules.

Minimal Migration Plan / Tests

  • Add conditional logic in TaccStaticFilesConfig to read TACCSITE_STATICFILES_IGNORE_PATTERNS and only register ignores when set.
  • Tests: run collectstatic --no-input in a test environment and assert files from static/.../src are present when ignore patterns are unset; assert they are absent when set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovements or additions to existing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions