I followed the instructions on https://docs.djangoproject.com/en/5.0/ref/contrib/staticfiles/#s-customizing-the-ignored-pattern-list to override the ignore_patterns in my static files. Here are my steps:
- Created a new app
app_staticfiles
. - in
app_staticfiles/apps.py
, this code:
from django.contrib.staticfiles.apps import StaticFilesConfig
class AppStaticfilesConfig(StaticFilesConfig):
name = 'app_staticfiles'
ignore_patterns = ["CVS", ".*", "*~", "*.map",
"*.min.css", "*.min.js", "*.scss"]
In original staticfiles, there is the management
directory that has the following commands collectstatic
and findstatic
.
- Django project
settings.py
modified:
INSTALLED_APPS = [
# ...
# 'django.contrib.staticfiles',
'app_staticfiles',
]
Now when I run collectstatic
, I get error Unknown command
. Obviously since I have commented out the original app from Django. Is there a way for this to run as-is without having to copy the management commands from original place to the overwriting app?