I have troubles searching for static files in multiple folders in development mode.
Of course I'm aware of the trivial approach to use os.path.listdir
or other methods to perform a search, but I am looking for a way to keep development and production code in line as much as possible.
I have the following scenario: Multiple apps with separate static folders and a project wide static folder, which works just fine.
But I have a method that looks for specific files and I want to make sure all folders are searched.
Of course I could construct those paths by reading settings.STATICFILES_DIR[]
and figure out with apps have 'static/'
folders, but I wonder if that would mean reinventing the wheel.
Is there a special method for dev mode that delivers a list of all static folders available or something like that?
If possible I would like to avoid a special debug case in my code because it doesn't appear very pythonic to me. But please correct me if I'm wrong here.