I have a MyApp/static/MyApp directory.
When I run ./manage.py collectstatic, I expect the MyApp directory be copied to STATIC_ROOT, but it doesn’t.
I have DownloadedApp/static/DownloadedApp as well and its copied to STATIC_ROOT fine.
What am I missing?
What are the
STATIC_ROOT,STATICFILES_FINDERS, andSTATICFILES_DIRSin yoursettings.py?When
collectstaticis run, the defaultSTATICFILES_FINDERSvaluedjango.contrib.staticfiles.finders.FileSystemFinderwill collect your static files from any paths that you have inSTATICFILES_DIRS.The other default
STATICFILES_FINDERSvaluedjango.contrib.staticfiles.finders.AppDirectoriesFinderwill look in the/static/folder of any apps in yourINSTALLED_APPS.All of the static files that are found will be placed in the specified
STATIC_ROOTdirectory.Check out this link to the collectstatic docs
And this link an explanation of the various static settings in settings.py
You can also use
python manage.py findstaticto see which directoriescollectstaticwill look in.