In einer Entwicklungsumgebung möchte ich statische Dateien aus den App-Verzeichnissen verwenden.
#settings.py
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
STATIC_ROOT = (os.path.join(SITE_ROOT, 'static_files/'))
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(SITE_ROOT, 'static/'),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
TEMPLATE_CONTEXT_PROCESSORS = (
#...
'django.core.context_processors.static',
#...
)
INSTALLED_APPS = (
#...
'django.contrib.staticfiles',
#...
)
I can find my static file if located in /static/css/file.css
but not if in an_app/static/css/file.css
.