https://github.com/zgr3doo/specificfilestaticfinder
Custom static file finder for Django
https://github.com/zgr3doo/specificfilestaticfinder
Last synced: 11 months ago
JSON representation
Custom static file finder for Django
- Host: GitHub
- URL: https://github.com/zgr3doo/specificfilestaticfinder
- Owner: zgr3doo
- Created: 2016-03-31T14:38:29.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-31T16:37:01.000Z (about 10 years ago)
- Last Synced: 2025-05-20T23:38:03.307Z (about 1 year ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SpecificFileStaticFinder
Custom static file finder for Django
This is static file finder for Django which will allow you to specify certain files instead of whole directories like FileSystemFinder do.
To install it just copy this folder into your project as an app and include it in your INSTALLED_APPS
include it in STATICFILES_FINDERS
STATICFILES_FINDERS = [
...
'SpecificFileStaticFinder.finder.SpecificFileStaticFinder',
...
]
and add this extra STATICFILES list into your settings.py which will include all files which should be included using collectstatic
STATICFILES = [
# Bootstrap
('css', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/bootstrap/dist/css/bootstrap.min.css'))),
('css', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/bootstrap/dist/css/bootstrap-theme.min.css'))),
('js', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/bootstrap/dist/js/bootstrap.min.js'))),
# Font Awesome
('css', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/css/font-awesome.min.css'))),
('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/fontawesome-webfont.eot'))),
('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/fontawesome-webfont.svg'))),
('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/fontawesome-webfont.ttf'))),
('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/fontawesome-webfont.woff'))),
('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/fontawesome-webfont.woff2'))),
('fonts', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/font-awesome/fonts/FontAwesome.otf'))),
# JQuery
('js', os.path.abspath(os.path.join(BASE_DIR, 'bower_components/jquery/dist/jquery.min.js'))),
]
Remember to use this pattern
STATICFILES = [
...
('folder', 'path/to/the/required.file'),
...
]
in order to achieve following file structure
/django_app/app/local/folder/required.file